Skip to main content
PacketMentor logo
Open menu
← 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.

Quick summary
  • 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.
IPv4 · 192.168.10.5/24 in bits19216810511000000101010000000101000000101network (24 bits)host (8 bits)/24 means: the first 24 bits are network, last 8 are hostAll hosts on the same /24 share the first 24 bits (192.168.10.*)
An IPv4 address is 32 bits. The subnet mask draws the line between the network portion (shared) and the host portion (unique).

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 to 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, 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

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

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.

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 →

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.