This may be a really dumb question, but I like to turn upside down what I already know sometimes, that way I can learn more. For example, given a network, I have a device inside with the IP Ok, nothing strange here. But why couldn't I have this same IP in other networks like the same I have but /25, /26, /27.....If with the subnet mask, I could know inside which network is the given device? I could have the same IP in more than one network only changing the subnet mask. I know that we can't repeat IPs, but what I want to understand is the WHY we can't, because as far as I can tell, we could repeat IPs because we have the subnet masks.

  • You can use duplicate addresses under certain circumstances . It’s called anycast addressing Jun 11, 2019 at 23:51
  • To add to Mike's comment, anycast is very specific in its' application. It works great for alot of UDP applications (not TCP) one example would be Anycast NTP.
    – user52444
    Jun 12, 2019 at 13:20
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Dec 15, 2019 at 3:53

2 Answers 2


why couldn't I have this same IP in other networks like the same I have but /25, /26, /27... I could have the same IP in more than one network only changing the subnet mask... We could repeat IPs because we have the subnet masks.

That idea ignores the fact that all routing is based on the longest prefix match. If you try this you will find that only one of the subnets will route to the .1 IP address (taking just one of the IP addresses as an example). What's more, some clients on the subnets would act like they could reach .1, but in reality it wouldn't be the same .1 that is responding elsewhere.

By using so many overlapping subnets, you will have a network that is rather difficult to operate and troubleshoot.

You don't need to believe me. Go ahead and try out what you're saying (using a subnet not critical to production); very soon, you'll want to hang up this duplicate addresses idea because it's so broken.

In all honesty, I have used overlapping subnets three or so times in my career to solve temporary problems when I was in a bind; the key here is that I never duplicated IP addresses even with overlapping subnets. Plus, I always built those overlapping subnets with the intention of tearing them down as soon as possible.


A network node routes each destination - it consults its local routing table and decides where the packet should go. There's no try-and-error, each routing decision is definitive. When that route fails to work the destination is unreachable.

Locally connected destinations - within the same subnet - are sent to directly (without a gateway). E.g. a source node with IP address/mask of talks directly to all IP address from to If these addresses exist elsewhere in your network they cannot be reached.

Non-local destinations are contacted using a router/gateway. In the simplest case, that is the default gateway with the routing entry - fits everything but is the last entry to check.

That gateway does the exact same thing - check if the destination is locally connected or requires a(nother) gateway, according to the gateway's routing table. Each forwarding decision on each router is only done once for a packet. There's no try-and-error and no checking if the destination is actually reachable on that route.

This forwarding process repeats until on the last hop, the destination must be locally connected. If it isn't the packet is dropped.

So, try to work out a way where you can have duplicate IP addresses without failing routes. It won't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.