IP Subnetting Cheat Sheet (free PDF) for Network Engineers

IP Subnetting Cheat Sheet Infographic

A Simple and Easy to understand IP Subnetting Cheat Sheet

With this IP subnetting cheat sheet article, we’ll provide you with all the details and show you how to subnet IP addresses, essential for network-related interviews, jobs, and exams. Understanding how subnetting works may seem difficult initially, but it begins to make sense as you continue. You can quickly create and deploy IP subnets that will give your organization the necessary level of design ease, scalability, management, and security you need.

IP Subnetting Cheat Sheet Infographic PDF

I hope you have downloaded the PDF, now let’s first understand a few basic things before diving into subnetting.

What is IP subnetting, and why do we need it?

IP Subnetting splits a network into multiple sub-networks, creating a partition based upon a consecutive block of IPv4 addresses, which is further represented by an IP address and the subnet mask.

Subnetting is widely used to preserve IP addresses and design scalable and secured networks. 

More on this later lets first understand IP address and other important concepts related to subnetting.

What is an IP address?

IP Address Explained
IP Address Explained

An IP address is a unique identifier for every computer, server, router, and hardware that connects to the network. But, first, let’s understand a few needy greedy things about IP addresses.

  • It is a 32-bit binary number representing a specific physical location on the network. 
  • Three dots separate this 32-bit number and four blocks we call octets. Each octet represents 8 bits or 1 byte, which in turn, if you multiply by 4, will give 8×4=32 bits.
  •  IP addresses can be broken down into three categories, namely unicast (used on individual devices), multicast (allows someone to send information to a group of computers), and broadcast (which allows one computer to send information out to everyone). Unicast IP addresses are the most common type and are found on our laptops or other devices to connect to the Internet.

What is a subnet mask?

The subnet mask divides the IP address into the host and network addresses, defining which parts belong to the device and which to the network.

An IP address and a subnet mask provide complete information and numerical identification to any device that needs to connect to the network. Therefore, both types of addresses are always used in conjunction and have a length of 32 bits. These 32 bits are further split into four sections. Each portion is referred to as an Octet and includes 8 bits.

For example:- 192.168.100.1 255.255.255.0.

Here 192.168.100.1 is IP Address and 255.255.255.0 is Subnet Mask.

When you put the IP address and the subnet mask together, you can separate the network and host parts of the address. Here subnet mask is 255.255.255.0, so 192.168.100.0 will become Network Address, and the Host Address will become 0.0.0.1

What is Classless and Classful Ip addressing, and what is the difference?

IPv4 addresses were initially intended to be classful— ranging from Class A to Class E. Also, Unicast IPv4 addresses can be divided into two parts: the network portion and the Host ID portion of the address. Please check the table below.

ClassLeading bitsStartEndDefault Subnet MaskCIDRNetwork ID and Host ID and total Number of Host & Network Support
Class A000000011.0.0.0126.255.255.255255.0.0.0/8- Uses (0-127) 8 bit of Network ID portion giving 127 networks. - Uses 24 bit of Host ID portion giving 16 million hosts per Network.
Class B10000000128.0.0.0191.255.255.255255.255.0.0/16- Uses (128-191) 16 bits of Network ID portion giving 16,000 networks. - Uses 16 bit of Host ID portion giving 65,000 hosts per Network.
Class C11000000192.0.0.0223.255.255.255255.255.255.0/24- Uses (192-223) 24 bits of Network ID portion giving 2 million networks. - Uses 8 bit of Host ID portion giving 254 hosts per Network.
Class D11100000224.0.0.0239.255.255.255Reserved for multicast groups.
Class E11110000240.0.0.0255.255.255.0Reserved for future usage or R&D.

Classful IP addressing worked within the bounds of the above-defined classes and was an old way of assigning IP addresses and subnets to a network.

As the Internet grew, this restricted assignment of IP addresses became a bottleneck. As a result, a more flexible and practical approach, called Classless IP Addressing, was developed.

What is the difference between Private and Public IP addresses?

  • Private ip addresses or sometimes referred to as Internal ip addresses are only meant to be used on private networks and should not be routed on the Internet.
  • And then there are Public ip addresses and can only be used on the Internet. You can check your public address by simply googling “what is my address.”
  • IANA has designated the following three blocks of IP address space for private use. 
  • You can refer to the below table for reserved private IP addresses.
Private IP Address with Subnet MaskPrivate IP RangePrivate IP Range denoted in CIDR
10.0.0.0 255.0.0.010.0.0.0 to 10.255.255.25510.0.0.0/8
172.16.0.0 255.240.0.0172.16.0.0 to 172.31.255.255172.16.0.0/12
192.168.0.0 255.255.0.0192.168.0.0 to 192.168.255.255192.168.0.0/16

What is CIDR, and why do we use it?

IETF created classless interdomain routing to provide greater granularity than classful routing; the CIDR notation is /XX.

For example: Instead of writing ip address with a subnet mask, which is 192.168.100.0 255.255.255.0, we can write 192.168.100.0/24

What is VLSM, and why do we use it?

When using VLSM, you can divide an IP address space into subnets of different sizes, from 0 to 32 bits. This makes subnets more useful because subnets can have masks of various sizes. CIDR uses VLSMs to create routes.

Quick Tip:- Before choosing a routing protocol, you should always check if the protocol supports VLSM or not. For example, classful routing protocols like RIPv1 and IGRP do not support VLSM.

How to convert Binary to Decimal and Decimal to Binary?

Ipv4 addresses are always represented in dotted-decimal separated by three dots for humans to understand easily. Further, these decimal numbers are converted into Binary numbers for further processing by machines. So we must know how to convert Binary to Decimal and vice versa. Binary is always represented in 1 or 0. However, any integer or non-integer number is Decimal, for example, 1,2,100,200, etc.

Example:- Convert Binary 11011011 into Decimal.

Binary to Decimal conversion example
Binary to Decimal conversion example

Please refer to the handy table for Binary to Decimal and Decimal to Binary conversion.

Binary
1 means the bit is ON
0 means the bit is OFF
Decimal
00
11
102
113
1004
1015
1106
1117
10008
10019
101010
101111
110012
110113
111014
111115
1000016
1000117
1001018
1001119
1010020
1010121
1011022
1011123
1100024
1100125
1101026
1101127
1110028
1110129
1111030
1111131
10000032
100000064
10000000128
100000000256
Binary to decimal conversion table

IP Subnetting Cheat Sheet

So now we know the basics of IP addressing and subnetting; let put it all together in an IP subnetting cheat sheet for quick reference.

The formula for usable IP addresses always deducts two IP addresses because two IPs are always reserved within any subnet. One IP is Network Address, and the second one is Broadcast Address.

CIDR NotationSubnet MaskTotal Number of NetworksFormula Used for Usable
Hosts= 2^(32 - Network Bits)
- 2
Wildcard Mask
/00.0.0.002^(32-0) - 2 = 2^32 - 2= 4,294,967,294255.255.255.255
/1128.0.0.012^(32-1) - 2 = 2^31 - 2 = 2,147,483,646127.255.255.255
/2192.0.0.022^(32-2) - 2 = 2^30 - 2 = 1,073,741,82263.255.255.255
/3224.0.0.032^(32-3) - 2 = 2^29 - 2 = 536,870,91031.255.255.255
/4240.0.0.042^(32-4) - 2 = 2^28 - 2 = 268,435,45415.255.255.255
/5248.0.0.052^(32-5) - 2 = 2^27 - 2 = 134,217,7267.255.255.255
/6252.0.0.062^(32-6) - 2 = 2^26 - 2 = 67,108,8623.255.255.255
/7254.0.0.072^(32-7) - 2 = 2^25 - 2 = 33,554,4301.255.255.255
/8255.0.0.082^(32-8) - 2 = 2^24 - 2 = 16,777,2140.255.255.255
/9255.128.0.092^(32-9) - 2 = 2^23 - 2 = 8,388,6060.127.255.255
/10255.192.0.0102^(32-10) - 2 = 2^22 - 2 = 4,194,3020.63.255.255
/11255.224.0.0112^(32-11) - 2 = 2^21 - 2 = 2,097,1500.31.255.255
/12255.240.0.0122^(32-12) - 2 = 2^20 - 2 = 1,048,5740.15.255.255
/13255.248.0.0132^(32-13) - 2 = 2^19 - 2 = 524,2860.7.255.255
/14255.252.0.0142^(32-14) - 2 = 2^18 - 2 = 262,1420.3.255.255
/15255.254.0.0152^(32-15) - 2 = 2^17 - 2 = 131,0700.1.255.255
/16255.255.0.0 162^(32-16) - 2 = 2^16 - 2 = 65,5340.0.255.255
/17255.255.128.0172^(32-17) - 2 = 2^15 - 2 = 32,7660.0.127.255
/18255.255.192.0182^(32-18) - 2 = 2^14 - 2 = 16,3820.0.63.255
/19255.255.224.0192^(32-19) - 2 = 2^13 - 2 = 8,1900.0.31.255
/20255.255.240.0202^(32-20) - 2 = 2^12 - 2 = 4,0940.0.15.255
/21255.255.248.0212^(32-21) - 2 = 2^11 - 2 = 2,0460.0.7.255
/22255.255.252.0222^(32-22) - 2 = 2^10 - 2 = 1,0220.0.3.255
/23255.255.254.0232^(32-23) - 2 = 2^9 - 2 = 5100.0.1.255
/24255.255.255.0242^(32-24) - 2 = 2^8 - 2 = 2540.0.0.255
/25255.255.255.128252^(32-25) - 2 = 2^7 - 2 = 1260.0.0.127
/26255.255.255.192262^(32-26) - 2 = 2^6 - 2 = 620.0.0.63
/27255.255.255.224272^(32-27) - 2 = 2^5 - 2 = 300.0.0.31
/28255.255.255.240282^(32-28) - 2 = 2^4 - 2 = 140.0.0.15
/29255.255.255.248292^(32-29) - 2 = 2^3 - 2 = 60.0.0.7
/30255.255.255.252302^(32-30) - 2 = 2^2 - 2 = 20.0.0.3
/31255.255.255.25431Total number of Hosts = 20.0.0.1
/32255.255.255.25532Total number of Hosts = 10.0.0.0
IP Subnetting Cheat Sheet

Let’s put it All together

Let’s take an example of the network configuration of your computer.

Let’s understand the main things here.

  • IPv4 Address of this computer is 192.168.2.15
  • Subnet Mask or subnet size or prefix length is 255.255.255.0
  • 192.168.2.15 is from the Private IP address range.
  • You can also write the above IP address and subnet mask in CIDR notion as 192.168.2.15/24
  • Default Gateway is 192.168.2.1
  • Let’s line up the IP address and Subnet Mask portion and convert Decimal numbers to Binary.
    • 11000000.10101000.00000010.00001111 — IP address (192.168.2.15)
    • 11111111.11111111.11111111.00000000 — Subnet mask (255.255.255.0)
  • As you can see above, there are the first three octets (24 bits) that make up the network address and the last octet (8 bits) that make up the host address. This gives you these things:
    • 11000000.10101000.00000010.00000000 — Network address (192.168.2.0)
    • 00000000.00000000.00000000. 00001111 — Host address (000.000.000.15)
  • The network address is 192.168.2.0 and the host address is 0.0.0.15. When a packet with a destination address of 192.168.2.15 will arrive on the 192.168.2.0 subnet, your computer will receive and process it.

Conclusion

In conclusion, IP Subnetting Cheat Sheet is a reference guide to subnetting. It includes an introduction to IP addressing, subnetting, IP subnets, classful/classless addressing, CIDR, and Binary to Decimal conversion table. I hope you have found this article useful! Please share it with others who you think might benefit from it. Let me know your thoughts in the comments below.

Default image
Afroz Ahmad
My name is Afroz. I am a CCIE, and I have been working in Networking Industry for more than 14 years. Currently, I work as a Network Designer for a large Organization. I write about technical topics and challenges a Network engineer faces in day-to-day life in my blog. I love to teach people, and I believe in the simple concept that teaching makes you a better learner.
Articles: 42

Leave a Reply