Skip to main content
Your first session is free. Claim mine
PacketMentor logo
Open menu
Home
Training
CCNA Library (74)
Browse all CCNA topics →
Network (13)
Device Operations (5)
Network Access (12)
Wireless (6)
IP Connectivity (10)
IP Services (11)
Security (10)
Automation (7)
CCNP Library (15)
LabsPricing
Contact 📞 +1 (860) 556-3010 Book a Call
← All topics
Network Fundamentals Foundational

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.

TL;DR
  • IPv4 is a 32-bit number, shown as four octets (0–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–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

/NBits onHosts per subnetUse case
/8816,777,214Huge legacy block
/161665,534Big enterprise LAN
/2424254Standard LAN segment
/30302Point-to-point WAN link
/32321 (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:

RangeSizeTypical use
10.0.0.0/816.7M addressesEnterprises that want lots of room
172.16.0.0/12 (172.16–172.31)1M addressesMid-size enterprises
192.168.0.0/1665K addressesHome 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

AddressWhat it isDon’t use it for
0.0.0.0Unspecified / “any”Hosts (it means “I don’t have one yet”)
127.0.0.0/8Loopback (commonly 127.0.0.1)Anything other than localhost
169.254.0.0/16APIPA (link-local)Real hosts — means DHCP failed
224.0.0.0/4MulticastUnicast hosts (it’s for groups)
255.255.255.255Local broadcastAnything (it’s a destination only)
First IP of any subnetNetwork addressHosts
Last IP of any subnetBroadcast addressHosts

If a user’s laptop has a 169.254.x.x IP, it didn’t get an answer from a DHCP server — 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 – 126.x, default mask /8
  • Class B: 128.x – 191.x, default mask /16
  • Class C: 192.x – 223.x, default mask /24
  • Class D: 224.x – 239.x, multicast
  • Class E: 240.x – 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 behaviour. 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 — one-line summary of every interface and its IP.

Common mistakes

  1. 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).

  2. 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. .0 and .255 on a /24 are off-limits.

  3. 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.

  4. 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.

  5. 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.

  6. 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

  1. On any router, configure ip address 10.10.10.1 255.255.255.252 on an interface. Calculate by hand: what’s the network, broadcast, and other usable IP?
  2. Verify with show ip interface brief.
  3. On a PC, manually set an IP in the same /30 range. Ping the router. Confirm reachability.
  4. Now set the PC’s IP to the network address (10.10.10.0) — observe the failure.
  5. Change to a different private range entirely (172.16.0.1/24). Configure on a second router interface. Confirm independent operation.
  6. 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

ConceptPlain English
32-bit addressFour octets, 0–255 each
Subnet maskTells you where network ends and host begins
Private ranges10/8 · 172.16/12 · 192.168/16. Internal only.
/30 vs /31Both 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.1Loopback — “this same machine”
0.0.0.0”Any” — used in default routes and unspecified contexts
/N notationModern. Classful network classes (A/B/C) are exam-only legacy.
Master this on a real network

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.

Claim my free session →

One topic per email, every fortnight

VLANs, OSPF, ACLs, subnetting, automation — written like this. Unsubscribe in one click.

We respect your inbox. One email per week, max. Unsubscribe any time.

Start typing — or browse popular topics below.

↑↓ navigate open Searches topics · labs · programs · pages