IP addresses are essential for identifying devices on a network. They are classified as either public or private, each serving different roles in communication.
Public IP addresses
What is a public IP address?
A public IP address is an address that is globally unique and routable over the internet. Devices that use public IP addresses can communicate directly with any other device on the internet. These addresses are required for websites, email servers, and other services that need to be publicly accessible.
When a device is assigned a public IP address, it becomes visible to all other internet users, making it possible to send and receive data from remote systems. Public IP addresses are usually allocated by an Internet Service Provider (ISP) and are either static (fixed) or dynamic (change over time).
Characteristics of public IP addresses
Globally unique: Each public IP must be unique across the entire internet to prevent conflicts.
Assigned by ISPs: ISPs receive IP blocks from regional internet registries and assign them to customers.
Routable over the internet: Routers on the internet know how to deliver packets to public IP addresses.
Used by servers and gateways: Services that must be accessible from outside a private network use public IPs.
Example of a public IP address
An example of a public IPv4 address is:
81.149.23.112
Practice Questions
FAQ
The IP address ranges reserved for private use were designated by the Internet Engineering Task Force (IETF) and managed by the Internet Assigned Numbers Authority (IANA) through RFC 1918. These ranges were selected to help manage the limited supply of IPv4 addresses by allowing organisations to reuse the same addresses within their local networks. Since private addresses are not routable over the public internet, they do not cause conflicts even if duplicated in different networks. The reserved ranges—10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16—are large enough to accommodate networks of various sizes. This design enables flexibility for homes, schools, and enterprises to structure internal IP address schemes without the need to register or coordinate with an external body. Internet routers are universally configured to drop traffic destined for or originating from these ranges, ensuring they remain isolated and do not interfere with global IP routing.
Yes, a device can be assigned both a public and private IP address if it is connected to more than one network interface or is configured for multiple network roles. A common example is a router or firewall appliance, which typically has one private IP address assigned to its internal network interface (used to communicate with devices on the local network) and one public IP address on its external interface (used to communicate with the wider internet). This dual assignment allows the device to act as a gateway, managing traffic between the private LAN and the internet. In some advanced networking setups, such as multi-homed servers, devices may have multiple interfaces for redundancy or specialised routing purposes, with both public and private IPs assigned. Careful configuration is needed to manage routing rules and security between interfaces to ensure that traffic flows correctly and securely between the internal and external networks.
When multiple devices use NAT to share one public IP, the router maintains a NAT translation table, also known as a state table or address mapping table. Each entry in the table stores details about an active connection, including the internal IP address and port number, the translated public IP and assigned external port, and the destination IP and port on the internet. This process is called Port Address Translation (PAT). For example, if two internal devices send requests to a web server, the router assigns unique external port numbers (e.g. 50210 and 50211) and records mappings like 192.168.1.2:51000 → 82.45.78.100:50210 and 192.168.1.3:51000 → 82.45.78.100:50211. When replies return, the router consults this table to forward responses to the correct internal device. The table dynamically updates with new connections and removes inactive entries based on timeouts or closed sessions to optimise memory and ensure accurate routing.
If two devices on the same local network are assigned the same private IP address, an IP address conflict occurs. This leads to unpredictable behaviour, such as one or both devices losing network connectivity, data being misrouted, or services failing to respond. Operating systems typically detect this condition by broadcasting Address Resolution Protocol (ARP) requests and receiving conflicting responses. When a conflict is detected, the device may display a warning, disable its network interface, or attempt to reassign itself a different IP. IP conflicts are common when IP addresses are manually assigned (static IP configuration) without coordination. To prevent this, networks use Dynamic Host Configuration Protocol (DHCP), which automatically manages IP allocation to ensure uniqueness. If static IPs are necessary, they should be assigned carefully outside the DHCP pool to avoid overlap. Network administrators often reserve static IPs for servers and printers, using documented IP plans to prevent accidental reuse.
While Network Address Translation (NAT) can hide internal IP addresses and limit unsolicited incoming traffic, it is not a substitute for proper security measures. NAT provides basic obfuscation by making internal devices inaccessible directly from the internet, but it does not inspect, filter, or control the content of network traffic. It also cannot prevent internal threats, malware communication, or unauthorised outbound connections. For comprehensive security, NAT should be combined with a firewall, which can enforce rules based on IP addresses, ports, protocols, and connection states. Firewalls can detect suspicious patterns, block access to harmful domains, and enforce content restrictions. Additionally, features like intrusion detection systems (IDS) and intrusion prevention systems (IPS) offer deep inspection that NAT cannot provide. Relying solely on NAT may lead to a false sense of security, as attackers can still exploit unpatched software, social engineering, or compromised outbound connections. Effective security involves layered defences, not just address translation.
