-1

So we have a private network:

172.16.0.0/12

that means:

10101100.00010000.00000000.00000000 (value: 172.16.0.0)
11111111.11110000.00000000.00000000 (subnet mask of /12)

How does that translate to the: 172.16.0.0 -- 172.31.255.255 range? Based on the subnet mask, if I understand it correctly, it should be 172.0.255.255 -- 172.15.255.255. Where does 31 come from?

MadHatter
  • 78,442
  • 20
  • 178
  • 229
pypipy
  • 3
  • 1
  • 3
  • @Colt it's related, though not a duplicate. That's similar to saying that question "why doesn't this Java algorithm work" is a duplicate to Oracle javadoc. Just for future reference. – pypipy Sep 16 '18 at 13:02
  • Your question, which is off-topic for other reasons too (such as, for example, seeking learning material), is completely answered in the _Canonical Question_ linked, which [is there in part to _prevent_ these off-topic questions](https://serverfault.com/help/duplicates). – Colt Sep 16 '18 at 13:08
  • 1
    This is not just related, it is exactly the sort of question the duplicate was intended to prevent. The community has long ago decided that we do not want yet more beginner questions about subnetting, and prepared the linked Q&A specifically for you and others who are trying to learn this. – Michael Hampton Sep 16 '18 at 18:14

1 Answers1

1

As the netmask denotes the network part, you must invert it to get the host part.

So the host part of a /12 network is 000FFFFF or 00000000-000FFFFF. If you have a network 172.16.0.0 or AC100000, the low address is AC100000 | 00000000 and the high address is AC100000 | 000FFFFF

10101100.00010000.00000000.00000000 (low address, 172.16.0.0)
00000000.00001111.11111111.11111111 (host mask)
10101100.00011111.11111111.11111111 (high address, 172.31.255.255)
RalfFriedl
  • 3,008
  • 4
  • 12
  • 17
  • Thanks, I see my error... I had the mask inverted, and as such, it didn't make sense to me. – pypipy Sep 16 '18 at 13:03