Routing – Identical IPv4 Addresses in Different Subnets
ipipv4routingsubnet
Is it possible to have two identical IP adresses in two different subnets such as PC1 and PC4?
Best Answer
Simply configuring PC1 with that address will not work. If a packet is destined for PC1, the router would look for the destination address in its routing table, and it would find that it should send the packet out the interface with the 10.0.32.0/24 address.
The original premise of IP is that every host is assigned a unique IP address, and this allows end-to-end IP connectivity. What you have breaks that, and it can cause problems.
There are some complex ways that you may be able to make this work, e.g. NAT, but this is something that you really want to avoid if at all possible.
There's no solution which satisfies all requirements, your answer of making 8 /27's is probably the most logical one.
You can easily verify this by trying to divide 256 by 7, you can't do this without a remainder. Also, all subnets need to have a size which is a power of 2, and 7 * 32 (a /27) = 252, 8 * 16 (a /26) = 512, so there's no way to do this without unused space.
I have seen this before on other host types. Putting in default gateway addresses should prevent this behavior. Without a default gateway, the host sends an ARP for the other host's layer-3 address, and it receives a reply because the hosts are on the same layer-2 domain. With a default gateway, the host would ARP for the gateway's layer-3 address, not the other host's layer-3 address, but there is no gateway address for which to ARP.
Best Answer
Simply configuring PC1 with that address will not work. If a packet is destined for PC1, the router would look for the destination address in its routing table, and it would find that it should send the packet out the interface with the
10.0.32.0/24
address.The original premise of IP is that every host is assigned a unique IP address, and this allows end-to-end IP connectivity. What you have breaks that, and it can cause problems.
There are some complex ways that you may be able to make this work, e.g. NAT, but this is something that you really want to avoid if at all possible.