0% found this document useful (0 votes)
34 views

Subnet Mask Cheat Sheet (2023) - Beginner To Advanced

Uploaded by

xideli9435
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Subnet Mask Cheat Sheet (2023) - Beginner To Advanced

Uploaded by

xideli9435
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

TutorialsDSAData ScienceWeb TechCourses

HTML Cheat Sheet CSS Cheat Sheet JS Cheat Sheet Bootstrap Cheat Sheet jQuery Cheat Sheet Angular Chea

Subnet Mask Cheat Sheet


Last Updated : 03 May, 2024
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,
255.255.255.0 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.

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 1/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

Table of Content
IPv4 Subnets (w/ Wildcard Mask Values)
Classification of IPV4 Address
Reserved IP Address
Private IPv4 Addresses
Special IPv4 Addresses
Bogon IPv4 Addresses

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.

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 2/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

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.

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 3/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

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 192.168.1.64 to


192.168.1.127 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 192.168.1.64. 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.

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 4/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

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 0.0.0.0


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:-
194.10.12.1(IP Address), 255.255.255.0 (Subnet Mask)

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


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. (194.10.12.1/24)

IPv4 Subnets (w/ Wildcard Mask Values)

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 5/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

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

CIDR SUBNET WILDCARD # OF IP # OF USABLE


MASK MASK ADDRESSES IP
ADDRESSES

/32 255.255.255.255 0.0.0.0 1 1

/31 255.255.255.254 0.0.0.1 2 2*

/30 255.255.255.252 0.0.0.3 4 2

/29 255.255.255.248 0.0.0.7 8 6

/28 255.255.255.240 0.0.0.15 16 14

/27 255.255.255.224 0.0.0.31 32 30

/26 255.255.255.192 0.0.0.63 64 62

/25 255.255.255.128 0.0.0.127 128 126

/24 255.255.255.0 0.0.0.255 256 254

/23 255.255.254.0 0.0.1.255 512 510

/22 255.255.252.0 0.0.3.255 1024 1022

/21 255.255.248.0 0.0.7.255 2048 2046

/20 255.255.240.0 0.0.15.255 4096 4094

/19 255.255.224.0 0.0.31.255 8192 8190

/18 255.255.192.0 0.0.63.255 16,384 16382

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 6/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

CIDR SUBNET WILDCARD # OF IP # OF USABLE


MASK MASK ADDRESSES IP
ADDRESSES

/17 255.255.128.0 0.0.127.255 32,768 32766

/16 255.255.0.0 0.0.255.255 65,536 65534

/15 255.254.0.0 0.1.255.255 131,072 131070

/14 255.252.0.0 0.3.255.255 262,144 262,142

/13 255.248.0.0 0.7.255.255 524,288 524,286

/12 255.240.0.0 0.15.255.255 1,048,576 1,048,574

/11 255.224.0.0 0.31.255.255 2,097,152 2,097,150

/10 255.192.0.0 0.63.255.255 4,194,304 4,194,302

/9 255.128.0.0 0.127.255.255 8,388,608 8,388,606

/8 255.0.0.0 0.255.255.255 16,777,216 16,777,214

/7 254.0.0.0 1.255.255.255 33,554,432 33,554,430

/6 252.0.0.0 3.255.255.255 67,108,864 67,108,862

/5 248.0.0.0 7.255.255.255 134,217,728 134,217,726

/4 240.0.0.0 15.255.255.255 268,435,456 268,435,454

/3 224.0.0.0 31.255.255.255 536,870,912 536,870,910

/2 192.0.0.0 63.255.255.255 1,073,741,824 1,073,741,822

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 7/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

CIDR SUBNET WILDCARD # OF IP # OF USABLE


MASK MASK ADDRESSES IP
ADDRESSES

/1 128.0.0.0 127.255.255.255 2,147,483,648 2,147,483,646

/0 0.0.0.0 255.255.255.255 4,294,967,296 4,294,967,294

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 Range Number of Representation in


IP Addresses Blocks the subnet mask

0.0.0.0-
Class A 128 255.0.0.0/8
127.255.255.255

128.0.0.0-
Class B 16,384 255.255.0.0/16
191.255.255.255

192.0.0.0-
Class C 2,097,152 255.255.255.0/24
223.255.255.255

224.0.0.0-
Class D n/a n/a
239.255.255.255

240.0.0.0-
Class E n/a n/a
255.255.255.255

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

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 8/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

SUBNET MASK WILDCARD

0 00000000 255 11111111

128 10000000 127 01111111

192 11000000 63 00111111

224 11100000 31 00011111

240 11110000 15 00001111

248 11111000 7 00000111

252 11111100 3 00000011

254 11111110 1 0000001

255 11111111 0 00000000

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

0.0.0.0/8 This network

10.0.0.0/8 Private IPv4 Address Block

100.64.0.0/10 Carrier-grade NAT

127.0.0.0/8 Loopback

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 9/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

Reserved IP Addresses

127.0.53.53 Name collision occurrence

169.254.0.0/16 Link local

172.16.0.0/12 Private IPv4 Address Block

192.0.0.0/24 IETF protocol assignments

192.0.2.0/24 TEST-NET-1

192.168.0.0/16 Private IPv4 Address Block

198.18.0.0/15 Network benchmark testing

198.51.100.0/24 TEST-NET-2

255.255.255.255 Limited 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 A 10.0.0.0 – 10.255.255.255

Class B 172.16.0.0 – 172.31.255.255

Class c 192.168.0.0 – 192.168.255.255

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 10/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

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 Host 127.0.0.0 – 127.255.255.255

APIPA 169.254.0.0 – 169.254.255.255

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

0.0.0.0/8 Reserved address space

10.0.0.0/8 Private network (RFC 1918)

100.64.0.0/10 Shared address space (CGN)

127.0.0.0/8 Loopback address

169.254.0.0/16 Link-local address (Autoconfiguration)

172.16.0.0/12 Private network (RFC 1918)

192.0.0.0/24 Reserved address space used for documentation

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 11/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

Bogon IPv4 Address Range Description

192.0.2.0/24 Reserved address space used for documentation

192.168.0.0/16 Private network (RFC 1918)

198.51.100.0/24 Reserved address space used for documentation

203.0.113.0/24 Reserved address space used for documentation

240.0.0.0/4 Reserved 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.

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 12/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

Summary
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

RFC1918 10.0.0.0 – 10.255.255.255

Localhost 127.0.0.0 – 127.255.255.255

RFC1918 172.16.0.0 – 172.31.255.255

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 13/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

Reserved Ranges

RFC1918 192.168.0.0 – 192.168.255.255

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

"GeeksforGeeks helped me ace the GATE exam! Whenever I had any doubt
regarding any topic, GFG always helped me and made my concepts quiet
clear." - Anshika Modi | AIR 21

Choose GeeksforGeeks as your perfect GATE 2025 Preparation partner with


these newly launched programs
GATE CS & IT
GATE DS & AI
GATE Offline (Delhi/NCR)

Over 125,000+ students already trust us to be their GATE Exam guide. Join
them & let us help you in opening the GATE to top-tech IITs & NITs!

S shub… 2

Next Article
Subnet Mask Cheat Sheet

Similar Reads

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 14/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

Finding Network ID of a Subnet (using Subnet Mask)


In order to find network id (NID) of a Subnet, one must be fully acquainted with the Subnet
mask. Subnet Mask: It is used to find which IP address belongs to which Subnet. It is a 32 bi…
2 min read

Fixed Length and Variable Length Subnet Mask Numericals


Before starting off with this article make sure you know the basics of Subnetting and
Classless Addressing. 1. Fixed-Length Subnet Mask : When a block of addresses is divided…
5 min read

C Program to find IP Address, Subnet Mask & Default Gateway


Terminology IP Address : An IP address, short for Internet Protocol address, is an identifying
number for a piece of network hardware. Having an IP address allows a device to…
2 min read

Role of Subnet Mask


The host or client address and the network or server address are the two parts of the IP
address that are present on every computer device. Either a DHCP server or a human, using…
6 min read

Is 255.0.255.0 a Subnet Mask?


Answer: No, 255.0.255.0 is not a valid subnet mask.Subnet masks are comprised of a series
of consecutive binary 1s followed by binary 0s, indicating the network portion and the host…
1 min read

View More Articles

Article Tags : Cheat Sheet GFG Sheets Computer Networks

A-143, 9th Floor, Sovereign Corporate


Tower, Sector-136, Noida, Uttar Pradesh -
201305

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 15/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced

Company Explore
About Us Hack-A-Thons
Legal GfG Weekly Contest
Careers DSA in JAVA/C++
In Media Master System Design
Contact Us Master CP
Advertise with us GeeksforGeeks Videos
GFG Corporate Solution Geeks Community
Placement Training Program

Languages DSA
Python Data Structures
Java Algorithms
C++ DSA for Beginners
PHP Basic DSA Problems
GoLang DSA Roadmap
SQL Top 100 DSA Interview Problems
R Language DSA Roadmap by Sandeep Jain
Android Tutorial All Cheat Sheets
Tutorials Archive

Data Science & ML HTML & CSS


Data Science With Python HTML
Data Science For Beginner CSS
Machine Learning Tutorial Web Templates
ML Maths CSS Frameworks
Data Visualisation Tutorial Bootstrap
Pandas Tutorial Tailwind CSS
NumPy Tutorial SASS
NLP Tutorial LESS
Deep Learning Tutorial Web Design

Python Tutorial Computer Science


Python Programming Examples Operating Systems
Python Projects Computer Network
Python Tkinter Database Management System
Web Scraping Software Engineering
OpenCV Tutorial Digital Logic Design
Python Interview Question Engineering Maths
Django

DevOps Competitive Programming


Git Top DS or Algo for CP
AWS Top 50 Tree
https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 16/17
6/4/24, 1:12 PM Subnet Mask Cheat Sheet (2023): Beginner to Advanced
Docker Top 50 Graph
Kubernetes Top 50 Array
Azure Top 50 String
GCP Top 50 DP
DevOps Roadmap Top 15 Websites for CP

System Design JavaScript


High Level Design JavaScript Examples
Low Level Design TypeScript
UML Diagrams ReactJS
Interview Guide NextJS
Design Patterns AngularJS
OOAD NodeJS
System Design Bootcamp Lodash
Interview Questions Web Browser

Preparation Corner School Subjects


Company-Wise Recruitment Process Mathematics
Resume Templates Physics
Aptitude Preparation Chemistry
Puzzles Biology
Company-Wise Preparation Social Science
English Grammar
World GK

Management & Finance Free Online Tools


Management Typing Test
HR Management Image Editor
Finance Code Formatters
Organisational Behaviour Code Converters
Marketing Currency Converter
Random Number Generator
Random Password Generator

More Tutorials GeeksforGeeks Videos


Software Development DSA
Software Testing Python
Product Management Java
SEO - Search Engine Optimization C++
Linux Web Development
Excel Data Science
All Cheatsheets CS Subjects

@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

https://www.geeksforgeeks.org/subnet-cheat-sheet/?ref=lbp 17/17

You might also like