You are on page 1of 11

8/28/22, 2:13 PM (99+) How to know if two IP addresses are in the same network | LinkedIn

2 99+

Home My Network Jobs Messaging Notifications Me Work

How to know if two IP


addresses are in the same
network
Published on August 2, 2019

Priyanka Kumari
Experience In IT networks , Enterprise Switching, Wireless ,Datacenter, Web
Streaming, CDN.

https://www.linkedin.com/pulse/how-know-two-ip-addresses-same-network-priyanka-kumari/ 1/11
8/28/22, 2:13 PM (99+) How to know if two IP addresses are in the same network | LinkedIn

112 articles
Follow 2 99+

Home My Network Jobs Messaging Notifications Me Work

So many times in networking specially during the technical discussion


we get confused with a very simple question that is "whether these two
IP addresses are in same network or in different network? I myself did
get confuse several times. So today I am just going to explain in a very
simple way to identify whether the two IPs are in the same network or
different .

Let’s come back to the very basic of networking and discuss the classes
of IPs.

TCP/IP defines five classes of IP addresses: class A, B, C, D, and E.


Each class has a range of valid IP addresses. The value of the first octet
determines the class. IP addresses from the first three classes (A, B and
C) can be used for host addresses. The other two classes are used for
other purposes – class D for multicast and class E for experimental
purposes.

The system of IP address classes was developed for the purpose of


Internet IP addresses assignment. The classes created were based on the

https://www.linkedin.com/pulse/how-know-two-ip-addresses-same-network-priyanka-kumari/ 2/11
8/28/22, 2:13 PM (99+) How to know if two IP addresses are in the same network | LinkedIn

network size. For example, for the small number of networks with a2 99+

Home My Network Jobs Messaging Notifications Me Work


very large number of hosts, the Class A was created. The Class C was
created for numerous networks with small number of hosts

Classes of IP addresses are:

For the IP addresses from Class A, the first 8 bits (the first decimal
number) represent the network part, while the remaining 24 bits
represent the host part. For Class B, the first 16 bits (the first two
numbers) represent the network part, while the remaining 16 bits
represent the host part. For Class C, the first 24 bits represent the
network part, while the remaining 8 bits represent the host part.
https://www.linkedin.com/pulse/how-know-two-ip-addresses-same-network-priyanka-kumari/ 3/11
8/28/22, 2:13 PM (99+) How to know if two IP addresses are in the same network | LinkedIn

So how do you know if two IP addresses are on the same IP network2 or 99+

Home My Network Jobs Messaging Notifications Me Work


on two different IP networks? Unfortunately, it isn’t as easy as it is with
street addresses to see which part of an IP address that is the IP network
and which part belongs to the host addresses.

The answer is within


something called a Subnet
Mask. An IP address is always
combined with a Subnet Mask,
and it is the Subnet Mask that
determines which part of the
IP address that belongs to the
IP network and which part
that belongs to host addresses.

The answer is within something called a Subnet Mask. An IP address


is always combined with a Subnet Mask, and it is the Subnet Mask that
determines which part of the IP address that belongs to the IP network
and which part that belongs to host addresses.

https://www.linkedin.com/pulse/how-know-two-ip-addresses-same-network-priyanka-kumari/ 4/11
8/28/22, 2:13 PM (99+) How to know if two IP addresses are in the same network | LinkedIn

Consider the following IP addresses: 2 99+

Home My Network Jobs Messaging Notifications Me Work

Before going through the example please have a look into the
subnetting of class C address.

192.168.1.14 /24 mask 255.255.255.0 would be on the same


network as 192.168.1.128/24 mask 255.255.255.0. But if the mask
was 255.255.255.128 that is /25 then they would not.. the last host

https://www.linkedin.com/pulse/how-know-two-ip-addresses-same-network-priyanka-kumari/ 5/11
8/28/22, 2:13 PM (99+) How to know if two IP addresses are in the same network | LinkedIn

2 99+
of the first subnet would be .126.If the mask was only 255.255.0.0
Home My Network Jobs Messaging Notifications Me Work
then 192.168.1.? and 192.168.254.? would be on the same network.

10.50.120.7 – Since this is a Class A address, the first number (10)


represents the network part, while the remainder of the address
represents the host part (50.120.7). This means that, in order for
devices to be on the same network, the first number of their IP
addresses has to be the same for both devices. In this case, a device
with the IP address of 10.47.8.4 is on the same network as the
device with the IP address listed above. The device with the IP
address 11.5.4.3 is not on the same network, because the first
number of its IP address is different.

172.16.55.13 – because this is a Class B address, the first two


numbers (172.16) represent the network part, while the remainder
of the address represents the host part (55.13). A device with the IP
address of 172.16.254.3 is on the same network, while a device
with the IP address of 172.55.54.74 isn’t.

 NOTE

https://www.linkedin.com/pulse/how-know-two-ip-addresses-same-network-priyanka-kumari/ 6/11
8/28/22, 2:13 PM (99+) How to know if two IP addresses are in the same network | LinkedIn

2 99+
The system of network address ranges described here is generally
Home My Network Jobs Messaging Notifications Me Work
bypassed today by use of the Classless Inter-Domain Routing
(CIDR) addressing.We will be discussing the Classless and Classful
addressing in our next article.

Special IP address ranges that are used for special purposes are:

0.0.0.0/8 – addresses used to communicate with the local network

127.0.0.0/8 – loopback addresses

169.254.0.0/16 – link-local addresses (APIPA)

Report this

Published by
Priyanka Kumari 112 Follow
Experience In IT networks , Enterprise Switching, Wireless ,Datacenter,
articles
Web Streaming, CDN.
Published • 3y

#Basic Networking # Two Ips are in the same network or in difefrent network

https://www.linkedin.com/pulse/how-know-two-ip-addresses-same-network-priyanka-kumari/ 7/11
8/28/22, 2:13 PM (99+) How to know if two IP addresses are in the same network | LinkedIn

Like 83 2 comments
2 99+
Comment Share
Home My Network Jobs Messaging Notifications Me Work

Reactions

+71

2 Comments
Most relevant


Add a comment…

Raghavendra Raikar •
3rd+ 1y (edited)
Staff Engineer at Tally Solutions Pvt Ltd

Is there any article covering IPV6 for the same topic? How will we know if two IPV6
addresses are in the same network?

Like Reply

Muzaffar Najib •
3rd+ 9mo
Services Specialist 🇦🇪 l Certified ATM Engineer l SLA & Incident Management l POS
Managed Services - Merchant Acquiring l Project Coordinator l IT Enthusiast

You have cleared my query, Thank you

Like Reply

Priyanka Kumari
Experience In IT networks , Enterprise Switching, Wireless ,Datacenter, Web Streaming, CDN.
https://www.linkedin.com/pulse/how-know-two-ip-addresses-same-network-priyanka-kumari/ 8/11
8/28/22, 2:13 PM (99+) How to know if two IP addresses are in the same network | LinkedIn

2 99+
Follow
Home My Network Jobs Messaging Notifications Me Work

More from Priyanka Kumari

WLC DHCP Option 43

Priyanka Kumari on LinkedIn

Configuration of Cisco CIMC (Cisco


Integrated Management Controller)

Priyanka Kumari on LinkedIn

https://www.linkedin.com/pulse/how-know-two-ip-addresses-same-network-priyanka-kumari/ 9/11
8/28/22, 2:13 PM (99+) How to know if two IP addresses are in the same network | LinkedIn

2 99+

Home My Network Jobs Messaging Notifications Me Work


EAP-TLS vs. EAP-TTLS
Priyanka Kumari on LinkedIn

A guide to diagnosing network


issues using MTR

Priyanka Kumari on LinkedIn

See all 112 articles

https://www.linkedin.com/pulse/how-know-two-ip-addresses-same-network-priyanka-kumari/ 10/11
8/28/22, 2:13 PM (99+) How to know if two IP addresses are in the same network | LinkedIn

2 99+

Home My Network Jobs Messaging Notifications Me Work

https://www.linkedin.com/pulse/how-know-two-ip-addresses-same-network-priyanka-kumari/ 11/11

You might also like