All topic guides
FundamentalsAmalgamated guide

IP Addressing & Subnetting

IPv4 classes, private ranges, CIDR, VLSM context, and hexadecimal for networking.

How the sources were combined

Panagiss IP Classes gives concise classful history and private-range context. jdepew88 Hexadecimal notes support MAC/IPv6 math. Combined with on-site subnetting trainer (SubnetIPv4-style drills).

Overview

IPv4 addressing and subnetting underpin every CCNA troubleshooting scenario. This guide covers classful history, private ranges, CIDR, VLSM context, wildcard masks, and hex math for MAC/IPv6 work.

IPv4 fundamentals

An IPv4 address is a 32-bit number written as four decimal octets separated by dots. Each octet ranges from 0 to 255 (8 bits). Example: 192.168.10.45 = 11000000.10101000.00001010.00101101 in binary.

Every routed interface needs a unique IP address within its subnet. The combination of IP address + subnet mask (or prefix length) defines which network the host belongs to and which bits identify the host portion.

Network vs host bits

Subnet mask bits set to 1 = network portion. Bits set to 0 = host portion. A /24 mask (255.255.255.0) means the first 24 bits are network, last 8 bits are host — 254 usable hosts per subnet.

Classful addressing — historical context

Before CIDR (1993), IPv4 used classful addressing. The first bits of the address determined the class and default mask. CCNA still tests this because legacy terminology persists in documentation and older routing protocols.

ClassFirst bitsDefault maskNetwork rangeNetworksHosts per network
A0/8 (255.0.0.0)1.0.0.0 – 126.0.0.0126~16.7 million
B10/16 (255.255.0.0)128.0.0.0 – 191.255.0.016,38465,534
C110/24 (255.255.255.0)192.0.0.0 – 223.255.0.0~2.1 million254
D1110None (multicast)224.0.0.0 – 239.255.255.255
E1111None (reserved)240.0.0.0 – 255.255.255.255

Reserved within Class A:

  • 0.0.0.0/8 — "this network" (not valid host addresses)
  • 127.0.0.0/8 — loopback (127.0.0.1 is localhost)
Exam trap

Classful boundaries still matter for RIP auto-summary and historical questions. Modern networks use CIDR — never assume a /24 just because the address "looks Class C."

RFC 1918 private address ranges

Private addresses are not routable on the public Internet. Organizations reuse them internally and translate at the edge with NAT.

ClassPrivate rangeCIDR notation
A10.0.0.0 – 10.255.255.25510.0.0.0/8
B172.16.0.0 – 172.31.255.255172.16.0.0/12
C192.168.0.0 – 192.168.255.255192.168.0.0/16

Other special-use ranges (know for CCNA):

RangePurpose
127.0.0.0/8Loopback
169.254.0.0/16Link-local (APIPA — no DHCP)
224.0.0.0 – 239.255.255.255IPv4 multicast (Class D)
255.255.255.255Limited broadcast

CIDR and VLSM

CIDR (Classless Inter-Domain Routing) replaced rigid class boundaries. The prefix length (/n) tells you exactly how many bits are the network portion.

Examples:

  • 192.168.1.0/24 — 256 addresses, 254 usable hosts
  • 192.168.1.0/25 — 128 addresses, 126 usable hosts
  • 192.168.1.0/26 — 64 addresses, 62 usable hosts
  • 192.168.1.0/30 — 4 addresses, 2 usable hosts (common for point-to-point links)

VLSM (Variable Length Subnet Masking) means different subnets in the same network can use different prefix lengths. A /24 can be split into two /25s, four /26s, etc. — design subnets to match actual host counts.

Worked example — /27 subnet

Network: 192.168.1.128/27 (mask 255.255.255.224)

  • Subnet size: 32 addresses (2^5 host bits)
  • Network address: 192.168.1.128
  • First usable host: 192.168.1.129
  • Last usable host: 192.168.1.158
  • Broadcast: 192.168.1.159

Host 192.168.1.130/27 falls in this range — valid host.

Practice makes permanent

Use the on-site Subnetting trainer for timed drills. Jeremy's IT Lab Subnetting Mastery playlist pairs well with repetition until /24 through /30 calculations are automatic.

Prefix notation quick reference

PrefixSubnet maskHosts per subnetTypical use
/8255.0.0.016,777,214Large enterprise (10/8)
/16255.255.0.065,534Campus
/24255.255.255.0254Department VLAN
/25255.255.255.128126Split /24
/26255.255.255.19262Small department
/27255.255.255.22430Small team
/28255.255.255.24014Point services
/30255.255.255.2522Router-to-router WAN
/32255.255.255.2551Host route / loopback

Binary math — the subnetting foundation

To subnet quickly, convert between decimal, binary, and (for MAC/IPv6) hexadecimal.

Example: Is 10.50.1.100 in the same subnet as 10.50.1.200 with mask /25?

  • /25 = 255.255.255.128 — the split is in the fourth octet
  • 100 = 01100100 → network bit is 0 → subnet .0
  • 200 = 11001000 → network bit is 1 → subnet .128
  • Different subnets — they need a router to communicate

Four questions every subnetting problem asks:

  1. What is the network address?
  2. What is the broadcast address?
  3. What is the range of valid hosts?
  4. What is the subnet mask?

Hexadecimal for networking

Hexadecimal (base 16) uses digits 0–9 and letters A–F. One hex digit represents 4 bits (one nibble). Two hex digits = one byte (8 bits).

DecimalBinaryHex
000000
101010A
151111F
160001 000010
2551111 1111FF

Conversion shortcut: Decimal → Binary → group binary into 4-bit nibbles → Hex.

IPv4 in hex

10.1.1.10A.01.01.01

  • 10 decimal = 00001010 binary = 0A hex
  • 1 decimal = 00000001 binary = 01 hex

224.1.2.3E0.01.02.03

MAC addresses

MAC addresses are 48 bits, written as six hex octets separated by colons or dashes:

00:1A:2B:3C:4D:5E

  • First 3 octets (OUI) = manufacturer
  • Last 3 octets = device-specific
  • Unicast: last bit of first octet = 0
  • Multicast: last bit of first octet = 1

IPv6 addresses

IPv6 uses 128 bits written as eight groups of four hex digits:

2001:0DB8:0000:0000:0000:0000:0000:0001

Shortening rules:

  1. Leading zeros in each group can be dropped: 2001:DB8:0:0:0:0:0:1
  2. One consecutive run of all-zero groups can be replaced with :: (once per address): 2001:DB8::1
Hex on exam day

You will not configure IPv6 from scratch on every CCNA question, but you must read MAC addresses, recognize IPv6 shortened notation, and convert simple decimal octets to hex when troubleshooting.

Subnet design workflow

Designing subnets for a site with Sales (40 hosts), Engineering (80 hosts), and Guest Wi-Fi (200 clients):

  1. Size each subnet — add growth margin, round up to power of 2
    • Sales: 40 → need 64 (/26)
    • Engineering: 80 → need 128 (/25)
    • Guest: 200 → need 256 (/24)
  2. Assign from a parent block — e.g., 10.10.0.0/16
    • Sales: 10.10.10.0/26
    • Engineering: 10.10.20.0/25
    • Guest: 10.10.30.0/24
  3. Document network, first host, last host, broadcast for each
  4. Assign gateway — typically .1 on each subnet

Commands to verify addressing

Cisco — verify IPv4 configuration

show ip interface brief show running-config interface GigabitEthernet0/0 show ip route connected

Host — check address assignment

! Windows ipconfig /all

! Linux / macOS ip addr show

Troubleshooting addressing issues

SymptomLikely cause
169.254.x.x (APIPA)DHCP failure — check server, relay, VLAN
Duplicate IP detectedTwo hosts with same address
Can reach local, not remoteWrong mask, missing gateway, or routing issue
VPN tunnel failsOverlapping private ranges on both sides

Exam checklist

  • List RFC 1918 ranges in both dotted-decimal and CIDR form
  • Explain classful vs classless addressing
  • Calculate network, broadcast, and host range for any /24–/30
  • Convert decimal octets to hex (for MAC and IPv6 context)
  • Read and shorten IPv6 addresses
  • Complete 10 timed problems on the subnetting trainer

Related lessons on this site

Continue in this domain

Fundamentals · guide 3 of 4

Sources & further reading

Panagiss CCNAmd

jdepew88 CCNA Notes (markdown)

This page is an amalgamated study guide synthesized from the markdown sources above, cross-checked against Cisco's official CCNA exam topics. Verify scope before your exam date.