Well, they are reserved by RFC 1918 for use in private networks.
But that doesn't actually matter much. You can obtain a block of "public" IP addresses from RIPE or whatever, and use it for your private network, and everything will still work. The reservation is needed only for political reasons, to allow admins to set up their own private networks without any trouble.
Tools like ping
do not care whether an address is "private" or "local" or "public". They simply send a packet to the given address, and your OS looks at the routing table to decide where to send it next.
For example, when you configure an Ethernet card on Windows with IP address 10.2.3.4/16
(in netmask format: 255.255.0.0
) and gateway 10.2.0.1
, it adds the following entries to the routing table:
10.2.3.4/32
(netmask 255.255.255.255
) to interface Loopback
(Your own addresses are always routed through the loopback interface, they never go to the network.)
10.2.0.0/16
(netmask 255.255.0.0
) to interface Local Area Connection
(Addresses in your own subnet are, by definition, local.)
0.0.0.0/0
(netmask 0.0.0.0
) to gateway 10.2.0.1
(Everything else is not local.)
In other words, you told the OS that all addresses within the 10.2.0.0/16
range are local, and the OS takes care of everything.
To view the routing table:
- on Linux,
ip route
(IPv4) and ip -6 route
(IPv6)
- on Windows,
route print
(IPv4 on ≤XP, both v4/v6 on ≥Vista)
- on Windows XP,
netsh interface ipv6 show route
(IPv6)
- on Windows, Linux, BSD, and other Unix-likes,
netstat -r -n
(IPv4)
- on Linux and some Unix-likes,
netstat -r -n -6
(IPv6)
Editing the routing table can be done with the same tools. For example, to mark all of 172.16.0.0/16
as local, you can use ip route add 172.16.0.0/16 dev eth0
on Linux.
5They do not know it and they do not care. Do you have a specific problem ? – BatchyX – 2013-08-10T14:28:47.233
@BatchyX I am just trying to understand how things work. And some program somewhere have to care if the adress is a part of the LAN or WAN. – totokaka – 2013-08-10T15:09:36.703
Why should they care ? – BatchyX – 2013-08-10T18:57:04.577