CIDR Cheat Sheet
June 21st, 2010
For those of you needing quick access to a CIDR/Dotted-decimal cheat sheet, we are providing you with the one below. This schema provides you with the CIDR notation, starting with /3, its Dotted-decimal counterpart, and the total number of available subnets within each network block:
| CIDR | Dotted-decimal | Subnets |
| /3 | 224.0.0.0 | 536870912 |
| /4 | 240.0.0.0 | 268435456 |
| /5 | 248.0.0.0 | 134217728 |
| /6 | 252.0.0.0 | 67108864 |
| /7 | 254.0.0.0 | 33554432 |
| /8 | 255.0.0.0 | 16777216 |
| /9 | 255.128.0.0 | 8388608 |
| /10 | 255.192.0.0 | 4194304 |
| /11 | 255.224.0.0 | 2097152 |
| /12 | 255.240.0.0 | 1048576 |
| /13 | 252.248.0.0 | 524288 |
| /14 | 255.252.0.0 | 262144 |
| /15 | 255.254.0.0 | 131072 |
| /16 | 255.255.0.0 | 65536 |
| /17 | 255.255.128.0 | 32768 |
| /18 | 255.255.192.0 | 16384 |
| /19 | 255.255.224.0 | 8192 |
| /20 | 255.255.240.0 | 4096 |
| /21 | 255.255.248.0 | 2048 |
| /22 | 255.255.252.0 | 1024 |
| /23 | 255.255.254.0 | 512 |
| /24 | 255.255.255.0 | 256 |
| /25 | 255.255.255.128 | 128 |
| /26 | 255.255.255.192 | 64 |
| /27 | 255.255.255.224 | 32 |
| /28 | 255.255.255.240 | 16 |
| /29 | 255.255.255.248 | 8 |
| /30 | 255.255.255.252 | 4 |
| /31 | 255.255.255.254 | 2 |
| /32 | 255.255.255.255 | 1 |
© 2010 – 2011, Stewart White. All rights reserved.
Congratulations for the amazing work you are presenting us here. I am afraid I am relatively green in fully understanding the IP notation and I have a question:
Suppose I wish to place a deny statement in my .htaccess file which includes a line for xx.0.0.0/16 or xx.0.0.0/24 or xx.0.0.0/32 what will be the range of IPs that will be denied in each one of the three cases. I am guessing that in the last one will be: xx.0.0.0 to 255.255.255.255 but I have the hunch that I am wrong.
Thank you
Costas – Toronto
each CIDR range you describe provides for a specific number of IP addresses
For example: /16 = 65536; /24 = 256; /32 = 1 address/
xx.o.o.o/16 = xx.0.0.0 – xx.0.255.255 (65536 IP addresses)
xx.0.0.0/24 = xx.0.0.0 – xx.0.0.255 (256 IP addresses)
xx.0.0.0/32 = xx.0.0.0 (1 IP address)
Based on the above you could add deny statements as follows:
deny from xx.o.o.o/16
deny from xx.o.o.o/24
deny from xx.o.o.o/32 (or just “deny from xx.o.o.o”)
Nice work Stewart.