IPv4 addressing
IPv4 address and prefix structure, public versus private ranges, address classes and the role of NAT for RFC 1918 space.
Address structure
An IPv4 address is 32 bits, written as four dotted-decimal octets. With a prefix length it splits into a network portion (shared by every host on the subnet) and a host portion (unique per device). The same address means different things under different masks — 10.1.2.3/24 and 10.1.2.3/16 describe different networks.
Historical address classes (context)
| Class | First octet | Default mask | Notes |
|---|---|---|---|
| A | 1–126 | /8 | 127.x is reserved for loopback |
| B | 128–191 | /16 | |
| C | 192–223 | /24 | |
| D | 224–239 | — | Multicast, not host addresses |
| E | 240–255 | — | Reserved/experimental |
Classes are obsolete for allocation (CIDR replaced them) but still referenced in documentation and exam questions.
- Address
- 172.20.5.9
- First octet 172 falls in 128–191 → class B shape, but classification is context only.
- 172.20.x.x sits inside 172.16.0.0/12 → it is RFC 1918 private space.
- Without a mask you cannot name the network or broadcast — always pair the address with its prefix.
172.20.5.9 is a private host address; it needs NAT to reach the internet.
Private addressing and NAT
RFC 1918 private ranges
| Range | CIDR | Addresses |
|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | ~16.7 million |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | ~1 million |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,536 |
Private addresses are not routed on the public internet; NAT translates them at the edge.
Private addressing exists because IPv4 space ran out: organizations reuse the RFC 1918 ranges internally and share a small pool of public addresses through NAT/PAT. Private space also removes the need to renumber when changing providers. 169.254.0.0/16 is link-local autoconfiguration (APIPA) — a host holding only an address from this range indicates DHCP discovery never completed.
Special IPv4 ranges
| Range | Purpose |
|---|---|
| 127.0.0.0/8 | Loopback — traffic never leaves the host |
| 169.254.0.0/16 | Link-local (APIPA) — self-assigned when DHCP fails |
| 224.0.0.0/4 | Multicast groups |
| 255.255.255.255 | Limited broadcast (this subnet only) |
| 0.0.0.0 | Unspecified source / default route notation |
Configuration and verification
Configure a router interface address — Privileged EXEC → Interface configuration
Cisco IOS / IOS XE
configure terminal interface gigabitethernet0/1 ip address 192.168.10.1 255.255.255.0 no shutdown end
show ip interface brief show ip interface gi0/1 ping 192.168.10.2
- Interface shows the configured address with up/up status.
- Ping to a host on the same subnet confirms L3 reachability.
Changes device configuration.
Common mistakes
- Calling 172.16–172.31.x.x 'public' — only the /12 is private; 172.15.x.x and 172.32.x.x are public.
- Forgetting that an address without a prefix is ambiguous — 192.168.1.10/24 vs /26 are different subnets.
- Treating 169.254.x.x as a valid DHCP lease — it signals the host self-assigned after DHCP timed out.
- Using classful logic for real networks — modern masks are arbitrary prefix lengths, not just /8 /16 /24.
Observation: PC shows 169.254.10.40 and cannot ping its gateway.
- DHCP server unreachable or exhausted
- Client on the wrong VLAN
- Static misconfiguration
| Check | Indicates |
|---|---|
Client address details (ipconfig /all, ip addr) | 169.254.x.x means no lease was obtained — confirm DHCP is enabled and check server/snooping logs for missing Offers. |
| DHCP scope and relay configuration | Missing ip helper-address on the SVI blocks broadcast discovery. |
| Client VLAN vs intended subnet | Wrong access VLAN places the host in a different broadcast domain. |
Correction: Restore DHCP reachability (scope, relay, VLAN) or fix the static settings.
Client receives an address in the expected subnet and pings the gateway.
Related resources
Sources
- Cisco CCNA 200-301 v1.1 Exam Topics (official PDF) — reviewed 2026-11-02
- RFC 1918 — Address Allocation for Private Internets — reviewed 2026-11-02
- Cisco — IP Addressing Services Command Reference — reviewed 2026-11-02
Targets CCNA 200-301 v1.1 objectives. Supplemental blocks are labeled beyond exam scope.