Skip to content

Latest commit

 

History

History
82 lines (66 loc) · 2.74 KB

cheatsheet_ipv4_subnetting.md

File metadata and controls

82 lines (66 loc) · 2.74 KB

Subnets

Bitmask Netmask Wildcard mask Hosts/subnet
/32 255.255.255.255 0.0.0.0 0
/31 255.255.255.254 0.0.0.1 0
/30 255.255.255.252 0.0.0.3 2
/29 255.255.255.248 0.0.0.7 6
/28 255.255.255.240 0.0.0.15 14
/27 255.255.255.224 0.0.0.31 30
/26 255.255.255.192 0.0.0.63 62
/25 255.255.255.128 0.0.0.127 126
/24 255.255.255.0 0.0.0.255 254
/23 255.255.254.0 0.0.1.255 510
/22 255.255.252.0 0.0.3.255 1.022
/21 255.255.248.0 0.0.7.255 2.046
/20 255.255.240.0 0.0.15.255 4.094
/19 255.255.224.0 0.0.31.255 8.190
/18 255.255.192.0 0.0.63.255 16.382
/17 255.255.128.0 0.0.127.255 32.766
/16 255.255.0.0 0.0.255.255 65.534
/15 255.254.0.0 0.1.255.255 131.07
/14 255.252.0.0 0.3.255.255 262.142
/13 255.248.0.0 0.7.255.255 524.286
/12 255.240.0.0 0.15.255.255 1.048.574
/11 255.224.0.0 0.31.255.255 2.097.150
/10 255.192.0.0 0.63.255.255 4.194.302
/9 255.128.0.0 0.127.255.255 8.388.606
/8 255.0.0.0 0.255.255.255 16.777.214
/7 254.0.0.0 1.255.255.255 33.554.430
/6 252.0.0.0 3.255.255.255 67.108.862
/5 248.0.0.0 7.255.255.255 134.217.726
/4 240.0.0.0 15.255.255.255 268.435.454
/3 224.0.0.0 31.255.255.255 536.870.909
/2 192.0.0.0 63.255.255.255 1.073.741.822
/1 128.0.0.0 127.255.255.255 2.147.483.646
/0 0.0.0.0 255.255.255.255 4.294.967.294

Convertion

Subnet Mask Wildcard Mask
255 1111 1111 0 0000 0000
254 1111 1110 1 0000 0001
252 1111 1100 3 0000 0011
248 1111 1000 7 0000 0111
240 1111 0000 15 0000 1111
224 1110 0000 31 0001 1111
192 1100 0000 63 0011 1111
128 1000 0000 127 0111 1111
0 0000 0000 255 1111 1111

Reserved Ranges

Type Range Prefix
RFC1918 0.0.0.0 - 10.255.255.255 10/8
Localhost 127.0.0.0 - 127.255.255.255 127/8
RFC1918 172.16.0.0 - 172.31.255.255 172.16/12
RFC1918 192.168.0.0 - 192.168.255.255 192.168/16

Address Class

Class Start bits begin @ end @ bitmask
A 0 0.0.0.0 127.255.255.255 /8
B 10 128.0.0.0 191.255.255.255 /16
C 110 192.0.0.0 223.255.255.255 /24
D (multicast) 1110 224.0.0.0 239.255.255.255 undef
E (reserved) 1111 240.0.0.0 255.255.255.255 undef

Notes

subnets = 2^(bitmask - bitmask class)
hosts = 2^(32 - bitmask) -2