Skip to main content
AD Academy
CCNA — Cisco Networking Fundamentals
Beginner16 minLast updated: Topic 3 of 12

IPv4 Addresses and Subnetting

Classes, CIDR, Subnet Calculation and VLSM — The most tested topic in CCNA.

Not read

What you will learn here

  • Quick Reference Table
  • Private Addresses (RFC1918)
  • Classes, CIDR, Subnet Calculation and VLSM — The most tested topic in CCNA.

Worth reading first:Switching, VLAN and Trunk

An IPv4 address is 32 bits, displayed in four numbers (e.g., 192.168.10.25). The Subnet Mask determines how many bits belong to the network and how many to the hosts within it.

Quick Reference Table

  • /24 = 255.255.255.0 → 256 addresses, 254 usable.
  • /25 = 255.255.255.128 → 128 addresses, 126 usable.
  • /26 = 255.255.255.192 → 64 addresses, 62 usable.
  • /27 = 255.255.255.224 → 32 addresses, 30 usable.
  • /30 = 255.255.255.252 → 4 addresses, 2 usable (router link).

Private Addresses (RFC1918)

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16
  • 169.254.0.0/16 — APIPA, indicates DHCP did not respond.
! Defining address on router interface
Router(config)# interface gi0/0
Router(config-if)# ip address 192.168.10.1 255.255.255.0
Router(config-if)# no shutdown

! Tests
Router# show ip interface brief
Router# show ip route
Router# ping 8.8.8.8
bash
Architecture and Theory — Under the Hood

Subnetting is borrowing bits from the Host part for the Network part. Each borrowed bit doubles the number of networks and halves the number of addresses in each network.

192.168.10.  0 /26
Mask 255.255.255.192  ->  11111111.11111111.11111111.11000000
Block size = 256 - 192 = 64
Subnets: .0-.63 | .64-.127 | .128-.191 | .192-.255
   .64  = Network      .65-.126 = Hosts
   .127 = Broadcast    Hosts = 2^6 - 2 = 62
text
  • Number of Addresses = 2^(32-prefix); Number of Usable Hosts = 2^(32-prefix) - 2.
  • Block Size = 256 - The last octet of the mask; from this, the boundaries of each subnet are derived.
  • VLSM: Allocate to each network exactly the size it needs — starting from largest to smallest.
  • Private Networks (RFC1918): 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
Practical Configuration (CLI)
R(config)# interface gi0/0
R(config-if)# ip address 192.168.10.65 255.255.255.192
R(config-if)# no shutdown
R(config)# interface loopback0
R(config-if)# ip address 1.1.1.1 255.255.255.255

R# show ip interface brief
R# show ip route connected
bash
# Windows / PowerShell
ipconfig /all
Get-NetIPAddress -AddressFamily IPv4
Test-NetConnection 192.168.10.65 -InformationLevel Detailed
powershell
Real-world Scenarios in an Organization
  • Address Planning by Site: 10.<site>.<vlan>.0/24 — easy to remember, easy to summarize with Route Summarization.
  • Size Matching: 50 users → /26 (62 hosts), 10 printers → /28 (14 hosts).
  • Reserve a range for DHCP and a separate range for static addresses (servers, printers, network equipment).
Troubleshooting
  • Incorrect subnet mask on client = client thinks destination is on its network and doesn't send to Gateway → no outgoing communication.
  • Network or Broadcast address assigned to a host → unstable communication.
  • Overlap between Subnets at two sites → unpredictable routing, especially in VPN.
ipconfig /all
route print              # Windows
show ip route            # Cisco
ping <gateway>
bash
Glossary and Quick Command Line
  • /24=254 | /25=126 | /26=62 | /27=30 | /28=14 | /29=6 | /30=2 hosts
  • Block size = 256 - mask octet
  • Built-in calculator on website: "Subnet Calculator" page

Check yourself

How many usable addresses are there in a /26 network?

A computer received the address 169.254.10.7. What does this mean?

Was this page helpful?