The /12 prefix means the first 12 bits of the address identify the network and the remaining 20 identify the host. Written out, the mask is 255.240.0.0, in binary 11111111.11110000.00000000.00000000, and its Cisco wildcard or inverse form is 0.15.255.255. It covers 1,048,576 addresses, of which 1,048,574 can be given to hosts.
| CIDR prefix | /12 |
|---|---|
| Subnet mask | 255.240.0.0 |
| Mask in binary | 11111111.11110000.00000000.00000000 |
| Wildcard (inverse) mask | 0.15.255.255 |
| Host bits | 20 |
| Total addresses | 1,048,576 |
| Usable hosts | 1,048,574 |
| Block size (magic number) | 16 in octet 2 |
A 10.0.0.0/8 contains 16 subnets of /12. Here are the first 8, which is enough to see the pattern: each one starts 16 after the last in octet 2.
| Network | First host | Last host | Broadcast |
|---|---|---|---|
| 10.0.0.0/12 | 10.0.0.1 | 10.15.255.254 | 10.15.255.255 |
| 10.16.0.0/12 | 10.16.0.1 | 10.31.255.254 | 10.31.255.255 |
| 10.32.0.0/12 | 10.32.0.1 | 10.47.255.254 | 10.47.255.255 |
| 10.48.0.0/12 | 10.48.0.1 | 10.63.255.254 | 10.63.255.255 |
| 10.64.0.0/12 | 10.64.0.1 | 10.79.255.254 | 10.79.255.255 |
| 10.80.0.0/12 | 10.80.0.1 | 10.95.255.254 | 10.95.255.255 |
| 10.96.0.0/12 | 10.96.0.1 | 10.111.255.254 | 10.111.255.255 |
| 10.112.0.0/12 | 10.112.0.1 | 10.127.255.254 | 10.127.255.255 |
Take the interesting octet of the mask, the one that is neither 255 nor 0. For /12 that is 240 in octet 2. Subtract it from 256:
256 - 240 = 16
That is the block size. Every /12 network address is a multiple of 16 in octet 2, so you can list them by counting: 0, 16, 32, 48, and so on. No binary needed once you know the number.
The /12 is the middle RFC 1918 block, 172.16.0.0/12, covering 172.16.0.0 through 172.31.255.255. It is the range Docker and several hypervisors reach for by default when they need private space, which is exactly why it collides so often with corporate VPN routes.
A /12 holds 1,048,576 addresses in total. After reserving the network and broadcast addresses, 1,048,574 are usable by hosts.
The /12 subnet mask is 255.240.0.0 in dotted-decimal notation.
The wildcard mask, also called the inverse mask, is 0.15.255.255. It is the bitwise inverse of 255.240.0.0 and is what Cisco access lists and OSPF network statements expect.
The /12 mask written out bit by bit is 11111111.11110000.00000000.00000000: 12 ones followed by 20 zeros.