IP Subnet Cheat Sheet

IP subnetting is the process of dividing a large IP network into smaller, more manageable subnetworks or subnet

IP subnetting involves partitioning the IP address space to create multiple logical networks within a single physical network. This is done by borrowing bits from the host portion of the IP address to create the subnet portion.

Why Subnetting is Important

  • Optimizing IP Address Allocation With the rapid growth of the internet and connected devices, conserving IP addresses has become crucial. Subnetting allows you to use IP address space more efficiently by assigning smaller blocks of addresses to individual subnets, preventing wastage.
  • Efficient Network Management Smaller subnets make it easier to manage and troubleshoot network issues. It helps in localizing problems within specific segments of the network, reducing the scope of network-wide outages.
  • Reducing Broadcast Traffic In a flat network (no subnets), broadcast messages are sent to all devices in the network. As the network grows, this broadcast traffic can become overwhelming. Subnetting breaks the network into smaller broadcast domains, reducing the number of devices that receive broadcast messages.
  • Enhancing Security Subnets create natural boundaries that can act as security perimeters. By controlling the flow of traffic between subnets, you can implement security measures and restrict communication between different parts of the network.

IP Address Classes and Reservations

IP address classes were a way of categorizing IP addresses into different ranges to accommodate varying sizes of networks. However, it’s important to note that the classful IP addressing system is now considered deprecated, and CIDR (Classless Inter-Domain Routing) is used for IP addressing and subnetting instead. Still, it’s useful to understand the concept.

Private IP addresses are non-routable addresses used within private networks and are not meant to be used on the public internet. These addresses are defined in RFC 1918 and are used to allow multiple devices within a private network to share a single public IP address.

Devices within a private network can communicate with each other using these private IP addresses, and a router with Network Address Translation (NAT) capability allows these devices to access the internet using a single public IP address. This helps conserve public IP addresses and ensures better security for internal networks. See the table below for IP address classes and reserved private IP addresses:

IP Address Classes and Range

ClassFormatIP RangeDefault Subnet Mask
Anetwork.host.host.host0.0.0.0 - 127.255.255.255255.0.0.0
Bnetwork.network.host.host128.0.0.0 - 191.255.255.255255.255.0.0
Cnetwork.network.network.host192.0.0.0 - 223.255.255.255255.255.255.0
DMulticast224.0.0.0 - 239.255.255.255None
EResearch240.0.0.0 - 255.255.255.255None

Reserved Private IP Address Space

Class A10.0.0.0 - 10.255.255.255
Class B172.16.0.0 - 172.31.255.255
Class C192.168 - 192.168.255.255
LocalHost127.0.0.0 - 127.255.255.255
ZeroConf.169.254 - 169.254.255.255

Subnet Mask

The subnet mask is a critical component of IP subnetting. It helps devices determine which part of an IP address belongs to the network, which part belongs to the subnet, and which part is for the host (specific device). The subnet mask is expressed in the same format as an IP address (e.g., 255.255.255.0). It has ones (1) in the bit positions corresponding to the network and subnet parts, and zeros (0) in the bit positions corresponding to the host part.

Word NotationDecimal NotationBinary Notation
IP Address192.168.1.1011000000.10101000.00000001.00001010
Subnet Mask255.255.255.011111111.11111111.11111111.00000000

For example, in the IP address 192.168.1.10 with a subnet mask of 255.255.255.0 (or /24 in CIDR notation), the first 24 bits represent the network and subnet, while the remaining 8 bits represent the host part.

Subnet MaskWildcard
00000000025511111111
1281000000012701111111
192110000006300111111
224111000003100011111
240111100001500001111
24811111000700000111
25211111100300000011
25411111110100000001
25511111111000000000

Classless Inter-Domain Routing (CIDR)

CIDR is a notation used to represent the subnet mask and IP address together. It helps simplify the representation of subnet masks. In CIDR notation, the subnet mask is represented as a forward slash followed by the number of bits set to 1 in the mask. For example, /24 represents a subnet mask of 255.255.255.0.

CIDR Chart

CIDRSubnet MaskNo. of AddressesWildcard
/32255.255.255.25510.0.0.0
/31255.255.255.25420.0.0.1
/30255.255.255.25240.0.0.3
/29255.255.255.24880.0.0.7
/28255.255.255.240160.0.0.15
/27255.255.255.224320.0.0.31
/26255.255.255.192640.0.0.63
/25255.255.255.1281280.0.0.127
/24255.255.255.02560.0.0.255
/23255.255.254.05120.0.1.255
/22255.255.252.010240.0.3.255
/21255.255.248.020480.0.7.255
/20255.255.240.040960.0.15.255
/19255.255.224.081920.0.31.255
/18255.255.192.0163840.0.63.255
/17255.255.128.0327680.0.127.255
/16255.255.0.0655360.0.255.255
/15255.254.0.01310720.1.255.255
/14255.252.0.02621440.3.255.255
/13255.248.0.05242880.7.255.255
/12255.240.0.010485760.15.255.255
/11255.224.0.020971520.31.255.255
/10255.192.0.041943040.63.255.255
/9255.128.0.083886080.127.255.255
/8255.0.0.0167772160.255.255.255
/7254.0.0.0335544321.255.255.255
/6252.0.0.0671088643.255.255.255
/5248.0.0.01342177287.255.255.255
/4240.0.0.026843545615.255.255.255
/3224.0.0.053687091231.255.255.255
/2192.0.0.0107374182463.255.255.255
/1128.0.0.02147483648127.255.255.255
/00.0.0.04294967296255.255.255.255

IP Block Sizes

PrefixMaskHostBlock Size
/25128126128
/261926264
/272243032
/282401416
/2924868
/3025224

Subnetting Process

The subnetting process involves determining the number of subnets required and the number of hosts in each subnet. It’s essential to strike a balance between the number of subnets and the number of hosts needed in each subnet. You must also consider future growth when designing subnets.

There are various subnetting methods, such as fixed length, variable length, and subnetting using VLSM (Variable Length Subnet Masking), which allows subnets to have different sizes based on their specific requirements. Understanding subnet masks and CIDR notation is essential for proper IP subnetting design.

Brief VLSM Subnetting Chart

Subnet1248163264128256
Host2561286432168421
Subnet Mask/24/25/26/27/28/29/30/31/32