3 IP Addressing and Network Configuration
Learn how IPv4 and IPv6 addresses, prefixes, address assignment, gateways, and DNS work together in a consistent network configuration.
What an does
An identifies a network interface so that it can send and receive Internet Protocol traffic. A complete network configuration also indicates which destinations are local, where to send traffic for other networks, and which translates names into addresses.
IPv4 addresses and
An is 32 bits long and is usually written as four decimal octets, as in 192.168.10.70. A gives the number of leading bits used to identify the network. combines an address and , as in 192.168.10.64/26.
The equivalent for 192.168.10.64/26 is 255.255.255.192. In the mask, 1-bits mark the network portion and 0-bits mark the host portion.
Subnet sizes and address roles
divides an address block into smaller networks. For a conventional IPv4 subnet with host bits, the total number of addresses is:
Typically, the all-zero host value identifies the subnet, while the all-one host value is its directed broadcast address. The number of ordinary host addresses is therefore:
For 192.168.10.64/26, there are 6 host bits and 64 total addresses. The block ranges from 192.168.10.64 through 192.168.10.127. Conventionally, .64 is the subnet address, .127 is the broadcast address, and .65 through .126 are available for hosts. Its is 255.255.255.192.
Private blocks
Three IPv4 blocks are reserved for : 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These addresses are intended for use within and are not globally unique Internet destinations. A router commonly connects a private network to the Internet, often using network address translation.
IPv6 addresses and prefixes
An is 128 bits long and is written as eight groups of hexadecimal digits separated by colons, as in 2001:db8:12:34::5. Leading zeros in a group may be omitted. The notation :: compresses one or more consecutive all-zero groups and can appear only once in an address.
IPv6 has unicast, anycast, and multicast addresses, but it has no broadcast address. As with IPv4, a slash prefix specifies the number of network bits. For example, 2001:db8:12:34::/64 has 64 network bits. A /64 is common for an IPv6 subnet, although prefix lengths are chosen according to the network’s design.
IPv6 link-local addresses use fe80::/10 and are for communication on the local link. Unique-local addresses use fc00::/7 for local addressing and are not intended as globally reachable Internet addresses.
How addresses are assigned
Addresses can be entered manually or assigned through address-configuration mechanisms.
: An administrator enters the address and other settings manually. This can suit infrastructure such as servers, but the chosen address must match the subnet and must not conflict with another device.
for IPv4: A server assigns an address for a lease period and can provide other settings, including the and router. A managed address pool helps prevent conflicts with manually assigned addresses.
IPv6 autoconfiguration: With , a host uses a prefix advertised by a router to form an address. can assign addresses or provide other configuration information, and it may be used alongside . IPv6 Router Advertisements also provide information hosts use to identify routers, so alone should not be assumed to supply the .
Core host configuration
A host’s configuration commonly includes four settings:
: The address assigned to the host’s interface.
or : The setting that identifies the local network portion of the address.
: The local router used when the destination is outside the host’s subnet.
: The service asked to translate domain names into IP addresses.
For example, a device might use 192.168.10.70, mask 255.255.255.192 (/26), gateway 192.168.10.65, and a DNS server supplied by . The device and gateway are both within 192.168.10.64/26, so the device can send local-subnet traffic directly and forward off-subnet traffic to the gateway.
Configuration and connectivity checks
A sound setup chooses a prefix large enough for the intended network, assigns the gateway an address in the appropriate subnet, configures a pool that avoids conflicting assignments, and supplies valid DNS settings.
When diagnosing connectivity, check that the host has an address and prefix, can reach its gateway, and has a working . IPv4 and IPv6 prefixes distinguish network bits from host bits and help define which destinations are local. organizes address space into manageable networks, while correct operation depends on a consistent address and prefix, a suitable , and DNS configuration.