IPv4 Addressing
32-bit addresses, dotted decimal, classful vs classless, private ranges, and the special addresses (loopback, broadcast, APIPA) you should never accidentally use for production hosts.
- IPv4 is a 32-bit number, shown as four octets (0 to 255) separated by dots.
- Each address has a network portion and a host portion; the subnet mask is what tells you where the line is.
- Three private ranges (10.x, 172.16 to 31.x, 192.168.x) are reserved for internal use and never routed on the public internet.
Mental model
An IPv4 address is just a 32-bit number, about four billion possible values. We write it as four 8-bit chunks (octets) separated by dots, in decimal, because nobody wants to read 11000000.10101000.00001010.00000101 aloud.
192.168.10.5 ← human-readable
11000000.10101000.00001010.00000101 ← what the network actually sees
Every IPv4 address has two pieces glued together:
- Network portion: the part shared by everyone on the same LAN
- Host portion: the part unique to each device on that LAN
The subnet mask is what draws the line between them. /24 says “first 24 bits are network, last 8 are host.” Everything to the left of the line is shared; everything to the right is unique.
How to read a /N mask
| /N | Bits on | Hosts per subnet | Use case |
|---|---|---|---|
| /8 | 8 | 16,777,214 | Huge legacy block |
| /16 | 16 | 65,534 | Big enterprise LAN |
| /24 | 24 | 254 | Standard LAN segment |
| /30 | 30 | 2 | Point-to-point WAN link |
| /32 | 32 | 1 (just the host) | Loopbacks, host routes |
Mask is the inverse of “host bits”: /24 means 24 network bits, so 32−24 = 8 host bits = 2⁸ = 256 addresses minus 2 (network + broadcast) = 254 usable hosts.
Three private address ranges (RFC 1918)
These ranges never get routed on the public internet. Use them freely inside your own network:
| Range | Size | Typical use |
|---|---|---|
| 10.0.0.0/8 | 16.7M addresses | Enterprises that want lots of room |
| 172.16.0.0/12 (172.16 to 172.31) | 1M addresses | Mid-size enterprises |
| 192.168.0.0/16 | 65K addresses | Home routers, small offices |
If you see a packet on the public internet with a private source IP, it’s misconfigured or malicious; internet routers drop it.
Special addresses you need to know
| Address | What it is | Don’t use it for |
|---|---|---|
| 0.0.0.0 | Unspecified / “any” | Hosts (it means “I don’t have one yet”) |
| 127.0.0.0/8 | Loopback (commonly 127.0.0.1) | Anything other than localhost |
| 169.254.0.0/16 | APIPA (link-local) | Real hosts: means DHCP failed |
| 224.0.0.0/4 | Multicast | Unicast hosts (it’s for groups) |
| 255.255.255.255 | Local broadcast | Anything (it’s a destination only) |
| First IP of any subnet | Network address | Hosts |
| Last IP of any subnet | Broadcast address | Hosts |
If a user’s laptop has a 169.254.x.x IP, it didn’t get an answer from a DHCP server, so the OS assigned itself a placeholder. Always check this when troubleshooting “no internet.”
Classful (legacy) vs Classless (modern)
Before 1993, IPv4 was split into classes based on the first few bits:
- Class A: 1.x to 126.x, default mask /8
- Class B: 128.x to 191.x, default mask /16
- Class C: 192.x to 223.x, default mask /24
- Class D: 224.x to 239.x, multicast
- Class E: 240.x to 255.x, reserved
CIDR (Classless Inter-Domain Routing) replaced this in 1993. Modern networking is classless. You use whatever prefix length fits. The terms “Class A network” or “Class C network” are only useful for talking about legacy protocol behavior. Say /24, not “Class C.”
The CCNA exam still references the classes, so know them. But never design a network around them.
Commands
Assign an IPv4 address to a Cisco interface
R1(config)# interface GigabitEthernet0/0
R1(config-if)# ip address 192.168.10.1 255.255.255.0
R1(config-if)# no shutdown
View interface IP configuration
R1# show ip interface brief
R1# show ip interface GigabitEthernet0/0
R1# show running-config interface GigabitEthernet0/0
show ip interface brief is the bread-and-butter command: a one-line summary of every interface and its IP.
Common mistakes
Confusing subnet mask with wildcard mask. Subnet mask =
255.255.255.0. Wildcard mask =0.0.0.255(inverse). Use the right one in the right context (ACLs and OSPF use wildcard; interface configs use subnet).Assigning the network or broadcast address to a host. The first IP of a subnet is the network, the last is the broadcast. Neither is usable.
.0and.255on a /24 are off-limits.Using private IPs and forgetting NAT. Hosts inside the network are 10.0.0.5; the public internet doesn’t route to that. Without NAT on the edge router, return traffic never arrives.
Assigning 169.254.x.x manually to a host. This is the APIPA range, reserved for failed DHCP. A real host with this address will get filtered or behave weirdly on most networks.
Treating /31 as unusable. Many engineers learned “you can’t use /31 because there’s only 2 addresses, both reserved.” RFC 3021 fixed this in 2000; modern routers happily use /31 for point-to-point links, saving IPs. Use /31, not /30, on point-to-point WAN.
Picking the same private range as another network you’ll later merge with. Two acquired companies both using 192.168.1.0/24 → painful renumber. Plan large ranges (10.x) from day one.
Lab to try tonight
- On any router, configure
ip address 10.10.10.1 255.255.255.252on an interface. Calculate by hand: what’s the network, broadcast, and other usable IP? - Verify with
show ip interface brief. - On a PC, manually set an IP in the same /30 range. Ping the router. Confirm reachability.
- Now set the PC’s IP to the network address (10.10.10.0), observe the failure.
- Change to a different private range entirely (172.16.0.1/24). Configure on a second router interface. Confirm independent operation.
- Bonus: enable a /31 on a point-to-point WAN link. Verify both ends can ping each other with only 2 addresses in the subnet.
Cheat strip
| Concept | Plain English |
|---|---|
| 32-bit address | Four octets, 0 to 255 each |
| Subnet mask | Tells you where network ends and host begins |
| Private ranges | 10/8 · 172.16/12 · 192.168/16. Internal only. |
| /30 vs /31 | Both for point-to-point. /31 (RFC 3021) saves 2 IPs. |
| 169.254.x.x (APIPA) | DHCP failed. Real hosts shouldn’t have this. |
| 127.0.0.1 | Loopback: “this same machine” |
| 0.0.0.0 | ”Any”: used in default routes and unspecified contexts |
| /N notation | Modern. Classful network classes (A/B/C) are exam-only legacy. |
Frequently asked questions
Q: What are the private IPv4 address ranges? A: Three blocks (RFC 1918): 10.0.0.0/8 (one /8, 16.7M addresses), 172.16.0.0/12 (sixteen /16s, 1M addresses), and 192.168.0.0/16 (256 /24s, 65K addresses). Never routable on the public internet; NAT translates them to public addresses at the network edge. Home routers use 192.168.0.0/24 or 192.168.1.0/24; enterprises typically use 10.0.0.0/8 for headroom.
Q: What’s the difference between a public and a private IP? A: Public IPs are globally unique and routable across the internet, assigned by IANA via regional registries (ARIN in North America). Private IPs (RFC 1918) can be reused by anyone since they never appear on public networks. Every internet-facing device needs a public IP; everything behind NAT shares one public IP. Public IPv4 is exhausted: new allocations cost money, which is why IPv6 exists.
Q: What’s APIPA and when does it kick in? A: Automatic Private IP Addressing: a Windows client picks a random 169.254.0.0/16 address when DHCP fails. If you see 169.254.x.x on a client, it means DHCP didn’t respond: either the DHCP server is down, the relay is misconfigured, or the client is on the wrong VLAN. Not useful for actual connectivity; it’s a diagnostic flag.
Q: Is 0.0.0.0 a valid IP address? A: Not as a source or destination for user traffic. It means “no IP” (unset) or “any IP” (as a wildcard in ACLs, routing, and socket binds). A default route is 0.0.0.0/0, meaning “match anything.” A server that binds to 0.0.0.0 listens on all its interfaces. Never assign it to an interface.
Practice: quick check
Every question in the bank, once. No repeats. Missed ones cycle back at the end.
Cisco IOS Device Management
How you actually log into and configure a Cisco device. Covers console / SSH / Telnet access, command modes (user / privileged / config), saving config, banners, the password types, and modern best practices for line security.
Spine-Leaf Architecture (Modern Data Center Topology)
The two-tier data center fabric that replaced core/distribution/access. Every leaf is one hop from every spine for predictable latency and easy scale-out.
Want this drilled into reflex?
1:1 weekly sessions, live feedback on your labs, and US interview prep: built around the CCNA® exam blueprint. Free first session. No card on file until you decide.
Related topics
OSI Model & TCP/IP
Two networking reference models compared side-by-side. The seven OSI layers, the four TCP/IP layers, and which one the real internet actually runs on (spoiler: not OSI).
Network FundamentalsPrivate IPv4 Addressing (RFC 1918)
The three private IPv4 ranges (10/8, 172.16/12 and 192.168/16) reserved for internal networks, hidden behind NAT and never routable on the public internet.
IP ConnectivityStatic Routing
CCNA static routing guide: next-hop vs exit-interface routes, default, floating and summary routes, recursive lookup, IPv6 statics and 8 worked scenarios.
Get the free CCNA 12-week roadmap
You're already reading up on IPv4 Addressing. The roadmap is the order I recommend studying every CCNA topic in: with what to lab each week and where IPv4 Addressing fits. A written personal reply, not an autoresponder. Expect it within one business day.
Personal reply from a senior network engineer. No third-party tracking. Unsubscribe any time.
