Week 2IP Connectivity35 min

CIDR and Subnet Masks

Learning objectives

  • Convert between CIDR prefix and dotted-decimal subnet masks
  • Identify mask length from binary patterns in any octet
  • Use masks to isolate the network portion of an address
  • Apply masks consistently in interface and routing configs

Watch first

Recommended video

Subnetting Mastery Part 3 — 60-Second Method

Video credit: Jeremy's IT Lab

Watch on YouTube
Recommended video

Hexadecimal to Decimal Made Easy! (Video #16)

Video credit: David Bombal

Watch on YouTube

Plain-English explanation

CIDR notation appends the prefix length after a slash: 192.168.10.0/26 means the first 26 bits are the network portion. The subnet mask is the same information in dotted decimal — network bits are 1s, host bits are 0s.

Examples in the last octet:

  • /24255.255.255.0
  • /25255.255.255.128
  • /26255.255.255.192
  • /27255.255.255.224
  • /28255.255.255.240

Additional topic reference

IP Classes — Panagiss CCNAmd notes

Deep dive

CIDR Conversion Table

CIDR prefix to subnet mask conversion table.

From study charts · jdepew88 CCNA notes

Binary view of /26 last octet: 11000000 = 128+64 = 192

Contiguous 1s from the left is required for valid subnet masks. 255.255.255.200 is invalid (non-contiguous).

Cross-octet prefixes: /20 means 20 network bits:

  • Mask: 255.255.240.0 (third octet: 11110000 = 240)
  • Block size 16 in the third octet

/23, /22, etc.: Practice borrowing bits across octet boundaries — exam favorites.

| Prefix | Mask | Block size (typical) | |--------|------|----------------------| | /8 | 255.0.0.0 | 2^24 in last three octets | | /16 | 255.255.0.0 | 256 in third octet | | /24 | 255.255.255.0 | 256 in fourth octet | | /30 | 255.255.255.252 | 4 addresses — WAN links |

Step-by-step — convert /20 to mask and block

  1. 20 network bits → four bits in third octet (16–19)
  2. Third octet binary: 11110000 = 240
  3. Mask: 255.255.240.0
  4. Block size in third octet: 256 − 240 = 16
  5. Networks: x.x.0.0, x.x.16.0, x.x.32.0 …

Commands to know

Cisco interface example

interface GigabitEthernet0/0 ip address 192.168.10.1 255.255.255.192 ! interface GigabitEthernet0/1 ip address 10.10.0.1 255.255.240.0

Verify mask on interface

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

Troubleshooting

| Issue | Check | |-------|-------| | Hosts same IP range, can't communicate | Mismatch mask — one /24, one /25 | | Routing summary wrong | Mask doesn't align with summary boundary | | ACL doesn't match intended subnet | Confused mask with wildcard |

Always write CIDR and mask together during design — they are two views of one truth.

Exam relevance

Exam trap

Do not confuse subnet mask with wildcard mask. They are inverses, not the same thing. Subnet 1 = network; wildcard 0 = must match.

60-second method

For last-octet prefixes, list 128, 192, 224, 240, 248, 252 paired with /25–/30 — speed beats brute-force binary on exam day.

Practice checklist

  • Convert /17, /20, /22, /25, /28 between CIDR and dotted decimal
  • Spot invalid masks (non-contiguous 1s) in a list of five
  • Given a mask, state the CIDR prefix without counting bit-by-bit slowly
  • Configure two interfaces with different masks and verify with show ip int brief
  • Complete subnetting trainer drills focused on mask conversion

What is the subnet mask for /27?

Which subnet mask is invalid?

Video credits

These are free, open educational videos from independent creators. We link and embed them with attribution; all rights belong to the respective channels.

Related tools