1

When it comes to local networks, you have the freedom to use any IP address you want for your network since it doesn't need to communicate on the internet with other devices. However, the RFC specified a range for private IP addresses (such as 10.x.x.x and 192.168.0-255.x). Why a range would be needed if the communication outside the local network uses a public IP address?. If I had a router with an interface g0/0 connected to the local network with the IP address 192.168.0.1 or 244.18.42.9, it doesn't make a difference because NAT will translate the IP addresses to a public address that will be the representative of the local network no matter what private IP address it has.

5
  • It doesn't help that much since NAT is not included in the best answer. My question is about NAT more than just the private and public IP addresses.
    – Strategist
    Apr 6, 2021 at 9:03
  • You (mainly) NAT beween private address space and public address space where a private address has no meaning. I'm not sure if I understand your question correctly.
    – Zac67
    Apr 6, 2021 at 9:16
  • I just don't understand the use of private addresses range when NAT can translate any private IP address to the public IP address used on the internet. The private IP address has no importance outside the local network then why would it need a range? what is the purpose if it'ss not used by other IP addresses outside the network to communicate?
    – Strategist
    Apr 6, 2021 at 9:26
  • 1
    If you use a public IP address inside your local network, requests to that address won't be routed to the Internet any more, rendering any service on it inaccessible. Private addresses are meaningless for devices outside your network but vital for devices inside your network.
    – Zac67
    Apr 6, 2021 at 9:33
  • This looks like a duplicate of the question "Usage of 192.168.xxx, 172.xxx and 10.xxx in private networks". Comments there point out problems when non-reserved addresses were used in real life: Hamachi using 5.0.0.0/8 and 25.0.0.0/8, and misc. private use of 1.0.0.0/8. Apr 7, 2021 at 18:56

2 Answers 2

5

RFC 1918 provides address ranges that you can safely use within a private network without any danger that these same addresses might be used on the public Internet.

Any node within your network needs to be able to address any destination it requires. If your local network uses the same address range (subnet) that some public servers do (e.g 244.18.42.0/24), that address range would be attempted to be sent to internally, without ever reaching the actually intended destination. As a result, such a server (e.g. 244.18.42.73) cannot be connected to from your network.

If your network doesn't connect to the Internet or doesn't require any services from it, then you could of course use any address/subnet you like. That however would effectively prevent your network to be easily connected to the Internet at a later time (been there, seen that, not recommended).

Since there's sufficient address range in RFC 1918 spaces for pretty much anything there's no good reason to do ignore proper private address allocation.

16
  • Then those private ranges are used to facilitate the connection to the internet? But the private IP will never be seen by other devices outside the local network since they will be translated with NAT to a public IP address given by the ISP right ?
    – Strategist
    Apr 6, 2021 at 9:32
  • Yes, you do need some kind of addressing within your private network. No, when using NAT these private addresses aren't seen by anyone outside, but they're vital for your own network.
    – Zac67
    Apr 6, 2021 at 9:37
  • 1
    @Strategist, "What will be different between a local network using 192.168.0.0/24 address and another network using 24.51.64.0/24?" The difference is that if your network ever needs to use a service, e.g. web site, on the 24.51.64.0/24 network that you are using internally, then you could never get there because the traffic would never reach your router. Routers route traffic between networks. Your hosts would see the destination on the same network and try to communicate with the destination on your network, never sending the traffic to the router (which would ignore it anyway).
    – Ron Maupin
    Apr 6, 2021 at 9:54
  • 1
    @Strategist, no, the hosts for that destination will never send the traffic to your router for NAT because they know the destination is on the same network as tey are.
    – Ron Maupin
    Apr 6, 2021 at 10:17
  • 3
    @Strategist, it seems you do not understand the way a LAN works. Yes, you can use any network in your LAN, but you could never connect to a host, server, service on the public Internet that has addressing in that network. Your traffic to such a destination would never leave your network. That is the entire point of private addressing. All the public addressing is unique, but there are not enough IPv4 addresses, so some were set aside to be used in private network, never to be seen on the public Internet.
    – Ron Maupin
    Apr 6, 2021 at 10:49
2

Why do we need private addresses such as RFC1918?

Well, say for instance you configure your local network with your router interface 8.8.8.1/24. You configure your clients with DHCP of range 8.8.8.100-8.8.8.254.

Everything will work fine, your clients in your local network will be able to contact each other. You can even S-NAT these addresses to your WAN-interface IP.

The problem however, say one of your clients on your other LAN network (192.168.0.0/24) is using 8.8.8.8 as DNS (google DNS). Your router will always send that packet out of its own connected interface, because that will always be the shortest path.

Also your clients in 8.8.8.0/24 network itself will never forward packets to the router interface, as the clients will try to ARP for 8.8.8.8

This is one reason why you have a set of RFC1918 addresses to use on your local network. Because no one is supposed to own these on public routed Internet.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.