# Does the same IP cause IP conflict if one is from /22 other is from /24?

I have two hosts. They both have the same IP/subnet, ex.: 1.2.3.4/24 on both. I know this is bad, since there will be duplicate IP in the network. OK.

But: If I have different (?) ranges:

1.2.3.4/22

and

1.2.3.4/24

for the same situation, will it cause IP conflict? Or since different subnet, they doesn't affect each other in any way?

• The same address is still the same address. X is always X; the size of the range is meaningless. Apr 18, 2018 at 17:07
• 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. Dec 25, 2018 at 8:22

An IPv4 address is a 32-bit number, and it doesn't matter if the mask is different, all 32 bits are the address, so if they are the same then it is the same address.

The mask (or mask length) simply determines which portion of the address represents the network, and which portion represents the host on the network. The `/24` network address is a subnet of the `/22` network. That means the `/24` network is part of the `/22` network, but the `/22` network also has other addresses not part of the `/24` network. The single address is part of the `/24` network, and by extension, part of the `/22` network that contains the `/24` network. The address is the same address, regardless of the network mask (or mask length).

The IPv4 packet headers do not contain any mask information; they only have the address, so there is no way to determine from the packet, which network you mean, so yes, you have two hosts with the same address.

Think of your networks/subnets as a binary tree. Adding a bit the the mask length simply halves the number of host addresses for the network. In the diagram below, it doesn't matter where you start on the binary tree above the host address (`/22`, `/23` `/24`, etc.), following down the binary tree will get you to the same final address:

The mask length just tells you where in the binary tree to start.

Generic concepts:

• IP address identify host in IP network. So if two hosts hawe same IP it's indistinguishable.

Short answer: Yes it still conflict.