What are public and private IP addresses, and which IPv4 addresses are special?
EasyConceptIP Addressing & Subnetting
Answer
A public IP address is globally unique and reachable on the internet; it is allocated through internet service providers (ISPs). A private IP address is reserved for use inside homes and organisations: any network may reuse it, and it is never routed on the public internet.
- Private ranges (RFC 1918):
10.0.0.0/8,172.16.0.0/12(172.16.0.0 to 172.31.255.255) and192.168.0.0/16. - Devices with private addresses reach the internet through NAT (Network Address Translation), which replaces the private source address with the router's public address.
- Special addresses:
127.0.0.1is loopback (the host itself);169.254.x.xis link-local, self-assigned when DHCP fails;0.0.0.0means "this host" or "any address". In every subnet, the first address is the network address and the last is the broadcast address, so neither is given to a host.
Example: At home, your laptop may have 192.168.1.7 and your phone 192.168.1.8 on the same Wi-Fi. A website you visit sees neither address. It sees only your router's single public address, such as 203.0.113.25, which the router shares between both devices using NAT.