5.2 Private addresses
In this part you will look at the problem raised by the use of private IPv4 addresses that are commonly set up for home networks.
Now watch the video below, which is about 4 minutes long.
Welcome to a session about NAT, network address translation.
Here I am at home, with a typical setup: I’ve got a desktop and a laptop connected to a home gateway which connects to the internet.
Let’s just check that everything is set up correctly. I’ll open a terminal on my desktop, type in ipconfig. My desktop has got an IP address of 192.168.0.100, and is connected through my home gateway which has an IP address 192.168.0.1. That looks good.
I can check that I can ping that gateway. And there we are, I’ve got some pings coming back from that.
I can also check to see if I can ping my laptop, which has got the IP address 192.168.0.101. Again, I’ve got some pings in return.
So that’s all good – the gateway is working as a switch, it’s dealing with traffic on the local area network, the LAN, which is my home network.
MSo my colleague Helen is also at home, with her desktop and her laptop. Her LAN is working fine too. She has the same gateway from the same ISP. So in fact the configuration is identical.
If Helen opens a terminal on her machine and does ipconfig, she should see exactly the same configuration as I did: 192.168.0.100 for her own IP address, the default gateway 192.168.0.1 for her home gateway.
Now on the face of it, this can’t be right. On the internet, every connected device has to have a unique IP address or the traffic can’t be routed correctly, but here we clearly have two PCs with the same IP address.
If I tried pinging from my machine to Helen’s machine, that’s clearly not going to work because they have the same IP address.
But in fact there is another reason why it wouldn’t work. The addresses used here, starting 192.168, are in a private address range. These are intended for use in private networks, like a home network, and routers will never pass those addresses through to the rest of the internet. They can be used to network within each LAN happily enough, but they can’t be reached over the internet.
You might have spotted another potential issue: we also have two identical home gateway routers on the internet, and both are set up as a gateway at private address 192.168.1.1, so is that a problem?
Well, no, it’s not a problem, because a router is always a two-faced device. It has one network interface that sits on the local area network, the inside. And it has another interface that sits on the outside, on the internet. Each interface will have a different IP address.
So if I just reveal the setup of this gateway, you can see both IP addresses: 192.168.0.1 on the LAN side and 184.108.40.206 on the internet. And on the other home gateway: 192.168.0.1 on the LAN and 220.127.116.11 on the internet. So the outside IP addresses, the ones which are on the internet, are different, and there’s no clash between them.
The domestic gateways will have been supplied by an ISP, in this case the same ISP, and they will be configured to have different IP addresses – probably by DHCP running from a central server at the ISP.
So we’ve seen that in a typical home network, the devices on it use private addresses, and different networks might in fact use identical IP addresses, so they can’t be visible on the internet. But the IP address of the outward side of the gateway router will have a unique IP address, so the gateway itself can be part of the internet. We’ll see how this lets home devices communicate with the internet through the gateway.
Home networks normally use addresses in an IPv4 private address range, most commonly starting 192.168.0.0. Addresses are obtained by DHCP from the home gateway provided by an internet service provider (ISP). (An ISP is the company who provides – and charges for – access to the internet from your home over broadband, optical fibre or satellite.) The ISP has many thousands of customers, each of whom has a home network on which devices might end up with the same IP address.
Since private addresses are not forwarded by routers, using the same IP address in different home networks does not cause clashes. However, private addresses can’t communicate with the internet. The gateway does connect to the internet; it is a router and has two network interfaces: one on the internal LAN and one on the internet. The IP address for the router’s external interface is not private so the router is able to communicate with the internet.
Activity 4 Test yourself
Identify the two correct statements in the list below.
IP addresses starting 192.168.0.0 are private addresses and are commonly used in home networks.
ISP stands for Internet Secret Protocol and is used to deliver packets to private addresses.
Devices can never have the same IP address, even on different home networks.
ISP is an abbreviation for internet service provider.
The correct answers are a and d.