2

If I configure a network with 10.0.0.0/16 it's range is from 10.0.0.1 to 10.0.255.254, so a host with an IP like 10.0.0.2/16 is ok.

But if I configure another network with IP alias (like IP address add 10.0.0.0/24 brd + dev eth0) and another host is configured with an ip like 10.0.0.2/24.

Will this work? Or it is a conflict?. The IPs are the same, but with different netmasks.

Excuse me the lack of testing but I don't have how to test this.

  • It will conflict... The subnet mask basically tells the computer if an address is intra or inter network, but 10.0.0.2 is 10.0.0.2 whether it is a /16 or a /24. I would suggest some basic research into IP addressing to understand what these things, like subnet mask, do. – acejavelin May 23 '16 at 14:30
  • Thanks for the answer. I myself would never do such configuration but it is a question that I have to answer so I was in doubt if it would work. Thanks again and excuse any english errors. – Paulo May 23 '16 at 14:34
  • 1
    No problem... Remember that the subnet mask is basically just a guide to say if something is inter or intra network, meaning (extremely simplified) the device uses the subnet mask to look at the destination IP and asks "is this in my network or subnet?" if the answer is yes, it communicates directly to that IP address, if the answer is no, then it communicates to the gateway so it can relay the communication to the IP address or more accurately to the next hop towards the destination. A different subnet mask and same IP within a single network does not make them unique. – acejavelin May 23 '16 at 14:45
  • I have added my comment as an answer now that I know this is the answer you were looking for, please accept and upvote if it satisfies your question. Thanks. – acejavelin May 23 '16 at 14:47
7

Yes, it will conflict...

The subnet mask basically tells the computer if an address is intra or inter network, but 10.0.0.2 is 10.0.0.2 whether it is a /16 or a /24. I would suggest some basic research into IP addressing to understand what these things, like subnet mask, do.

Remember that the subnet mask is basically just a guide to say if something is inter or intra network, meaning (extremely simplified) the device uses the subnet mask to look at the destination IP and asks "is this in my network or subnet?" if the answer is yes, it communicates directly to that IP address, if the answer is no, then it communicates to the gateway so it can relay the communication to the IP address or more accurately to the next hop towards the destination. A different subnet mask and same IP within a single network does not make them unique.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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