Open In App
Related Articles

Subnet Mask Cheat Sheet

Like Article
Save Article
Report issue

A Subnet Mask is a numerical value that describes a computer or device’s how to divide an IP address into two parts: the network portion and the host portion. The network element identifies the network to which the computer belongs and the host part identifies the unique computer on that network. An IP address is made up of four digits separated by dots, for example, and each number can be between 0 and 255, with higher values using more bits for the network and lesser values for the host. A subnet mask allows devices on the same network or across networks to interact with each other. Every system has a unquine IP address.

In this Subnetting Cheat Sheet, you’ll learn all the basic to advanced subnetting concepts, including CIDR notation, and IPv4 subnet masks ranging from XX.XX.XX.XX/0 to XX.XX.XX.XX/32, IPv4 wildcard mask values, classification of IPv4 addresses from Class A to Class E, and more.


Additionally, In this Subnetting Mask Cheat Sheet, you will also explore private IP addresses, special IP addresses, and bogon IP addresses, further enhancing your knowledge of network addressing.

What is Subnetting?

Subnetting is the technique of dividing one big network into multiple small networks. Subnet makes the network more efficient and easy to maintain. Subnets provide a shorter path to network traffic without passing through unnecessary routers to reach their destinations.Subnetting makes network routing much more efficient.

How Does Subnetting Work?

Let’s assume what happens when there is no subnetting in a Large network that has a million devices connected to them and they have their unique IP Address. Now, what happens when we send some information in that network from one device to another? In that case, our data/information passes through most of the unnecessary routers or devices until they find a destination device.

How Subnetting Works?

How Does Subnetting Works?

Now, think we divided the same network into smaller subnetworks. This helps make the routing of data more efficient. Instead of searching through millions of devices to find the right one, routers (check if the destination IP address falls within their range of subnet devices. If it does, they route the packet to the appropriate device. If it doesn’t, they forward the packet to another router) can use something called a subnet mask to determine which subnetwork a device belongs to.

What is Classful Addressing and Classless Addressing?

In Classful Addressing, we divided IPV4 Network into 5 classes(Class A, Class B, Class C, Class D, Class E) of fixed length. In Classful addressing IP addresses are allocated according to the classes- A to E. In this Scheme, Network ID and Host ID changes depend on the class.

On the Other Hand, CIDR or Class Inter-Domain Routing was introduced in 1993 to replace classful addressing. It allows the user to use VLSM or Variable Length Subnet Masks. So, there is no such restriction of class in classless addressing. The wastage of IP addresses has been improved after CIDR Addressing.

What is CIDR?

CIDR or Class Inter-Domain Routing allows the user to use VLSM or Variable Length Subnet Masks in order to make IP address allocation and IP routing that allows more efficient use of IP addresses.

Rules for forming CIDR Blocks:

  • All IP addresses must be contiguous or sequential.(NID=network ID , HID=host ID)
  • The block size must be the power of 2 (2n). If the size of the block is the power of 2, then it will be easy to divide the Network. Finding out the Block Id is very easy if the block size is of the power of 2. Example: If the Block size is 25 then, Host Id will contain 5 bits and Network will contain 32 – 5 = 27 bits.
What is CIDR?
  • The first IP address of the Block must be evenly divisible by the size of the block. in simple words, the least significant part should always start with zeroes in Host Id. Since all the least significant bits of Host Id are zero, then we can use it as the Block Id part.

Example: Let’s check whether the IP address block from to is a valid IP address block or not?

  • All the IP addresses in the block are contiguous.
  • Total number of IP addresses in the block is = 64 = 26
  • The first IP address in the block is We can observe that the Host ID contains the last 6 bits, and in this case, the least significant 6 bits are not all zeros. Therefore, the first IP address is not evenly divisible by the size of the block.

As a result, this block does not satisfy the criteria for a valid IP address block, and therefore, it is not a valid IP block.

Working on IP Address Block

An IP address is a 32-bit unique address having an address space of 232. The IPv4 address is divided into two parts:

  1. Network ID
  2. Host ID.

For Example:- IP addresses belonging to class A are assigned to the networks that contain many hosts. 

  • The network ID is 8 bits long.
  • The host ID is 24 bits long.

The higher-order bit of the first octet in class A is always set to 0. The remaining 7 bits in the first octet are used to determine network ID. The 24 bits of host ID are used to determine the host in any network. The default subnet mask for Class A is 255.x.x.x. Therefore, class A has a total of:

2^7-2= 126 network ID(Here 2 address is subtracted because and 127.x.y.z are special address. )

2^24 – 2 = 16,777,214 host ID

IP addresses belonging to class A range from 1.x.x.x – 126.x.x.x

How to Calculate CIDR Notation?

Here, step-by-step you can calculate the CIDR notation of any IP Address:

Step 1: First, find the IP address and the subnet mask. Ex:- Address), (Subnet Mask)

Step 2: Convert the subnet mask to binary. ( -> 11111111.11111111.11111111.00000000)

Step 3: Count the number of consecutive 1s in the binary subnet mask.(11111111.11111111.11111111)

Step 4: Determine the CIDR prefix length.(24’ones)

Step 5: Write the CIDR notation. (

IPv4 Subnets (w/ Wildcard Mask Values)

Here in the below charts, we will see pre-defined subnet masks, followed by some explanations of what they mean.


Classification of IPV4 Address

IPv4 addresses are classified into five classes: A, B, C, D, and E. The first octet(8 bits) of an IPv4 address determines the class of the address.

Classification of IP Addresses


Number of Blocks

Representation in the subnet mask

Class A0.0.0.0-
Class B128.0.0.0-,384255.255.0.0/16
Class C192.0.0.0-,097,152255.255.255.0/24
Class D224.0.0.0-
Class E240.0.0.0-

And here’s a table of the decimal to binary conversions for subnet mask and wildcard octets:



Reserved IP Address

Reserved IP addresses are a set of IP addresses that are not assigned to any specific device or network. 

Here are some examples of reserved IP address ranges:

Reserved IP Addresses network IPv4 Address Block NAT collision occurrence local IPv4 Address Block protocol assignments IPv4 Address Block benchmark testing Broadcast address

Private IPv4 Addresses

Private IPv4 addresses are a range of IP addresses that are not routable on the public internet. They are reserved for use within private networks, such as homes, businesses, and organizations. 

The range of private IPv4 addresses is:

Private IPv4 Addresses

Class A10.0.0.0 –
Class B172.16.0.0 –
Class c192.168.0.0 –

Special IPv4 Addresses

Special IPv4 addresses are a set of IP addresses, that serve specific purposes. These addresses are used for special functions and are not assigned to individual devices. 

Here are some examples of special IPv4 addresses:

Special IPv4 Addresses

Local Host127.0.0.0 –
APIPA169.254.0.0 –

Bogon IPv4 Addresses

A bogon IP address is an IP address that are not assigned or allocated to any specific entity or organization. Bogon addresses are typically used to filter or block suspicious or illegitimate network traffic. 

Here are some examples of bogon IPv4 address ranges:

Bogon IPv4 Address Range

Description address space network (RFC 1918) address space (CGN) address address (Autoconfiguration) network (RFC 1918) address space used for documentation address space used for documentation network (RFC 1918) address space used for documentation address space used for documentation for future use or experimental purposes

Why learning Subnetting is Important?

Learning to subnet is important for a number of reasons, including:

  • Conserving IP addresses: Subnetting allows for the efficient use of limited IPv4 addresses by dividing a larger network into smaller networks, conserving IP addresses and facilitating better management.
  • Improving network performance: Subnetting reduces the size of broadcast domains, reducing network congestion and improving performance by limiting the scope of broadcast messages.
  • Enhancing network security: Subnetting isolates different parts of a network, improving security by preventing unauthorized access to sensitive data.
  • Simplifying network management: Subnetting makes it easier to identify and troubleshoot problems by isolating issues to specific subnets, simplifying network management and troubleshooting processes.
  • Solitary organization: Gadgets on the equivalent subnet can speak with one another straightforwardly without going through a switch or other systems administration gadget.

By learning subnetting, you gain a comprehensive understanding of network design, management, and troubleshooting, making you a valuable asset in the field of networking.


Alright, wrapping it up, subnetting is pretty much a crucial skill for network admins and IT professionals. It’s all about managing and dishing out IP addresses in networks like a pro. This subnet cheat sheet? It’s your new best friend. It’s got everything you need to know about subnetting, from getting your head around IP addresses and subnet masks to the lingo like CIDR notation and VLSM. Just follow the guide, use the formulas and tables, and subnetting will be a walk in the park. Keep at it, and you’ll be a subnetting master in no time, creating slick network designs, using addresses like a boss, and boosting network performance.Limitations of subnetting. Communication between one subnet to another subnet requires a router. A poorly configured or fatally failed router can significantly impact your organization’s network.

Subnet Cheat Sheet – FAQs

1. How to Determine Usable Hosts?

To determine Usable host, You need to Subtract Subnet ID Address and BroadCast Address from Total Addresses. For Example:-

Usable hosts = Total Addresses – Subnet ID – Broadcast Address

Usable hosts = 256 – 1 – 1

Usable hosts = 254

2. What are the Reserved Ranges of IP Addresses?

Reserved Ranges


3. What if you had a 255.255 255.0 subnet?

A subnet mask of 255.255. 255.0 would give you lots of networks (2 16) and 254 hosts. A subnet of 255.255. 0.0 would give you lots of hosts (approx 216) and 256 networks

Last Updated : 08 Nov, 2023
Like Article
Save Article
Share your thoughts in the comments
Similar Reads