welw | About_me Blog WebAssembly

What is the 172.31/12 private IP pool?

While I was designing a failover network, I did not want to use 192.168.x.x, because it may collide with home networks.

There is at least one very well known private IP pool: 192.168.x.x. You have probably seen it at homes, or hotels, for example 192.168.0.1 or 192.168.1.1.

There are 2 more private IPv4 private pools: 10.0.0.0/8 and 172.31.0.0/12. The former covers the entire 10.x.x.x address space and I already use it for routing on my master network.

It is understandable, that:

Netmask | Sample addresses /32 | 192.168.1.1 /24 | 192.168.1.x /16 | 192.168.x.x /8 | 10.x.x.x

But how does /12 network mask work?

Let's draw the netmask in binary form. 16 = 00010000, so all addresses in form

11101100.0001xxxx.xxxxxxxx.xxxxxxxx

are valid.

We count from 12 up:

00010000 = 16
00010001 = 17
00010010 = 18
00010011 = 19
00010100 = 20
00010101 = 21
00010110 = 22
00010111 = 23
00011000 = 24
00011001 = 25
00011010 = 26
00011011 = 27
00011100 = 28
00011101 = 29
00011110 = 30
00011111 = 31

This gives us all addresses in form: 172.16.x.x 172.17.x.x 172.18.x.x 172.19.x.x 172.20.x.x 172.21.x.x 172.22.x.x 172.23.x.x 172.24.x.x 172.25.x.x 172.26.x.x 172.27.x.x 172.28.x.x 172.29.x.x 172.30.x.x 172.31.x.x.