How can two seemingly different subnets on the same segment talk toeach other?
I was in the process of creating a larger subnet on my home network and before I changed the prefix/mask on the last system I noticed that I could still ping and make ssh connections across what I believed to be a different subnet.
I have a mixture of physical and virtual machines in a home network environment (just for fun). Both Linux and Windows systems. I am working with 192.168.1.32/28 and 192.168.1.0/26. I have a DNS server and a DHCP server on 192.168.1.0/26 but the DHCP server is only serving a few addresses in the 192.168.1.32/28 ranges (because I haven't gotten to it yet). However, all of the systems involved right now have a hard coded ip address. The name server is also forwarding ip packets. I have a system with the address of 192.168.1.44 with a mask 255.255.255.240 broadcast 192.168.1.47. With this system I can access machines on 192.168.1.0/26 with the following addresses 192.168.1.41 and 192.168.1.39 while each of those have a netmask 255.255.255.192 and broadcast of 192.168.1.63. 192.168.1.41 is linux virtual machine(Ubuntu6.04) hosted on a windows system in the 192.168.1.0/26 subnet and 192.168.1.39(Mandrake10.0) is linux physical machine in the same subnet. 192.168.1.44/28(Open Suse10.3) is also a linux physical machine. Why are these systems talking to each other? |
Traceroute from one machine to another, your router between the different subnets is probably routing between them.
|
This works mostly because you have subnetted a subnet, are only using addresses common to both subnets, and have luckily avoided a trap.
Let's show what is happening with your addresses, and why everything seems to work. We'll start with unicast addresses. All of your networks are 192.168, so let's drop the first two of the four octects. And I'll call your networks NET1 and NET2. Your addresses look like: Code:
name: network network bits netmask network bcast ip range Quote:
Quote:
Quote:
Quote:
Quote:
You will also notice that all of your addresses (1.44, 1.39, 1.41) are in both NET1 and NET2. Therefore, you just happen to have two overlapping subnets, and just happen to be using only those addresses that are in both subnets. Thus, route processing strips off the network part to perform network packet switching, and all addresses fall within the same route. Now what about broadcast addresses? Since broadcast addresses don't cross network boundaries (aka: broadcast domains), there is no problem given the IPs you are currently using. In the chart below, You see that the broadcast bits look identical, with one exception: the 5th bit, which is 16. I've marked that bit with a ?. Code:
name: bcast bcast bits So it is only luck (or the well-worked out homework example here!) that allows this to work out. |
I think I get it now.
Quote:
If I am following you correctly, it would not haved worked if I had used the next subnet which would be 192.168.1.64/26 instead of 192.168.1.0/26? |
Sounds like you've got it.
|
Thank you! I can see how knowing this will help me avoid other more serious traps in the future. Like in the area of security.
|
All times are GMT -5. The time now is 03:26 AM. |