Networking

What happens Same IP Range different subnet mask

What happens Same IP Range different subnet mask explores the behavior of network traffic to same ip range with different subnet masks.

I had this question posed to me the other day and it is one of those curiosity questions that you may have asked before or perhaps had a situation that presented itself that gave cause to thinking about this question. ย What happens same ip range different subnet mask? ย And more accurately, what if you have (2) ip addresses that overlap each other or would in one of the subnets? ย Will the same router be able to service and ping both as well as carry pings for both? ย Well, let’s see.

What happens Same IP Range different subnet mask

Let’s quickly go over the setup which I thrown into Packet Tracer as a quick test config. ย So let’s say that the first IP address, 192.168.0.2 has a subnet mask of 255.255.255.0. ย The other IP address is 192.168.1.2 and has a subnet mask of 255.255.254.0.

The IP 192.168.0.2 would fall in the range of the subnet configured on the 192.168.1.2 address. ย Would it be able to ping the other IP? ย Also, would the same router have problems routing traffic between those two hosts?

Notice below the different IP addresses as well as the different subnet masks.

PC1

diffsub02

PC2

diffsub03

Router

diffsub04

What happens?

When the IPs and subnet masks are configured as above,ย both IPs will be able to ping the router IP and the router will be able to correctly return traffic back to both hosts as the IP and subnet on the router spans both IP ranges and is a summary route of sorts for both.

As you can see below, the first PC configured with the /24 subnet is able to ping the router and get pings back successfully.

diffsub05

Also, the second PC configured with the /23 subnet is also able to ping and get pings back successfully from the router.

diffsub06

What doesn’t work

One thing to keep in mind is that this only works because we are usingย differentย IPs configured on the PCs. ย If we tried to assign theย same IP address to both PCs even though the subnets are different, the traffic would not know how to get back to the proper PC that is configured.

Thoughts

So while in practice, this IP addressing works with the different subnets, and could even be used to segment traffic to some degree with one router, this is less than ideal because of the issue of duplicate IP addresses. ย If the same IP address is purposely or inadvertently configured on either subnet, the communication to both will be broken.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.