A detailed, step-by-step explanation of IP addresses — from basic concepts and addressing schemes to configuration, routing, and best practices.
An IP (Internet Protocol) address is a unique identifier assigned to every device on a network that uses the Internet Protocol for communication. It works like a postal address for your computer, phone, or IoT device, allowing data to be sent and received across local networks and the global Internet. This guide covers the history, structure, types, and practical usage of IP addressing.
Follow these step-by-step instructions to find your computer's IP address on both Windows and macOS:
cmd and press Enter to open Command Prompt.ipconfig and press Enter.IPv4 Address: 192.168.x.x.IPv6 Address in the same output.Wi-Fi is connected to MyNetwork and has IP address 192.168.x.x).ifconfig, then locate the inet entry under the appropriate interface (en0 for Wi-Fi, en1 for Ethernet).These methods reveal your private (local) IP address assigned by your router. To find your public (Internet) IP, visit a website like whatismyipaddress.com.
The concept of IP addressing originated in the 1970s with the development of the ARPANET. IPv4 (Internet Protocol version 4) standardized a 32-bit address system to route packets. As the Internet grew, IPv6 emerged in the 1990s with 128-bit addresses to overcome address exhaustion. IP allows diverse networks to interconnect seamlessly, forming the modern Internet.
IPv4 addresses are 32-bit numbers typically written in dotted-decimal notation (e.g., 192.168.0.1). Each of the four octets represents 8 bits (0-255). The address comprises a network portion (identifies the network) and a host portion (identifies the device). A subnet mask (e.g., 255.255.255.0) determines which bits belong to each portion.
IPv6 uses 128-bit addresses, written in eight groups of four hexadecimal digits (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). Leading zeros may be omitted and consecutive zero groups compressed using ::. IPv6 eliminates NAT by providing a vastly larger address space, supporting auto-configuration and built-in security.
Public IPs are globally routable on the Internet, assigned by ISPs. Private IPs (e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are used within local networks and not reachable from the Internet. Routers use NAT (Network Address Translation) to map private IPs to a public IP for external communication.
Early IPv4 used classful addressing: Class A (/8), B (/16), C (/24). This led to inefficient allocations. CIDR (Classless Inter-Domain Routing) introduced variable-length prefixes (e.g., 192.168.1.0/24), allowing more precise subnetting and efficient use of address space.
Subnetting divides networks into smaller subnets by extending the network prefix. For example, 192.168.1.0/24 can split into two /25 subnets (192.168.1.0/25 and 192.168.1.128/25) each with 126 usable addresses. CIDR notation (/25) indicates how many bits are fixed for the network, facilitating routing aggregation.
DHCP (Dynamic Host Configuration Protocol) automates IP assignment: devices request an address from a pool managed by a DHCP server. Static IPs are manually configured for servers, printers, or network devices requiring fixed addresses. Example DHCP range: 192.168.0.100 - 192.168.0.200.
DNS (Domain Name System) maps domain names to IP addresses. A records point names to IPv4, AAAA records to IPv6. Reverse DNS uses PTR records to map IPs back to hostnames. DNS resolution involves iterative and recursive queries across root, TLD, and authoritative servers.
Routers forward packets between networks based on routing tables. The default gateway is the router IP on your subnet that handles traffic destined for external networks. Static routes can be configured for specific paths; dynamic routing protocols (OSPF, BGP) automate route exchange between routers.
By the 2010s, available IPv4 addresses were depleted. Organizations use NAT and private addressing to extend usage. IPv6 adoption grows via dual-stack deployments, tunneling (6to4, Teredo), and translation (NAT64). IPv6 ensures global end-to-end connectivity and IPv4-IPv6 interoperability.
IP addresses can expose network topology and host information. Use firewalls to block unwanted traffic, implement IP whitelisting for critical services, and monitor logs for suspicious IPs. Geolocation and reputation services help identify malicious sources. IPv6 introduces unique privacy challenges—temporary addresses and privacy extensions mitigate tracking risks.
IPv6 defines multiple address types:
fe80::/10) for neighbor discovery only.fc00::/7), analogous to IPv4 private addresses.ff00::/8) for one-to-many delivery.Key commands and tools:
ipconfig/ifconfig to view local IPs.ping and tracert/traceroute to test reachability and path.nslookup/dig for DNS queries.Example static IPv4 setup on Windows:
192.168.1.50, Subnet: 255.255.255.0, Gateway: 192.168.1.1.8.8.8.8 and 8.8.4.4.Example IPv6 auto-configuration on Linux:
sudo sysctl net.ipv6.conf.all.autoconf=1
sudo dhclient -6 eth0
To deepen your IP networking knowledge, explore these resources: