Subnet Mask Cheat Sheet

A subnet mask is a 32-bit number that divides an IP address into network and host portions. The subnet mask is represented in dotted-decimal format, like an IP address. Here’s a cheat sheet for subnet masks:

  1. Default Subnet Masks:
    • Class A: 255.0.0.0 (CIDR /8)
    • Class B: 255.255.0.0 (CIDR /16)
    • Class C: 255.255.255.0 (CIDR /24)
  2. Common Subnet Masks:
    • /25: 255.255.255.128
    • /26: 255.255.255.192
    • /27: 255.255.255.224
    • /28: 255.255.255.240
    • /29: 255.255.255.248
    • /30: 255.255.255.252
  3. Subnet Mask and Hosts:
    • /24 (Class C): 256 addresses (254 usable)
    • /25: 128 addresses (126 usable)
    • /26: 64 addresses (62 usable)
    • /27: 32 addresses (30 usable)
    • /28: 16 addresses (14 usable)
    • /29: 8 addresses (6 usable)
    • /30: 4 addresses (2 usable)
  4. Subnetting Rules:
    • All 0s in the host portion: Network address.
    • All 1s in the host portion: Broadcast address.
    • Addresses with 0 in the host portion: Subnet ID.
    • Addresses with all 1s in the host portion: Directed Broadcast.
  5. Calculating Subnet Masks:
    • To calculate the subnet mask for a specific CIDR notation, subtract the CIDR value from 32.
      • Example: For CIDR /26, the subnet mask is 32 – 26 = 6 bits, resulting in 255.255.255.192.
  6. CIDR Notation:
    • CIDR (Classless Inter-Domain Routing) notation represents the number of network bits in the subnet mask. Example: /24.
  7. IPv6 Subnetting:
    • IPv6 uses a different subnetting approach, where each subnet has a fixed size of 64 bits for the host portion.

Understanding subnetting is essential for network administrators and those working with IP addresses to efficiently allocate and manage network resources. This cheat sheet provides a quick reference, but it’s recommended to practice subnetting exercises to solidify the understanding.