SaveMyCert
IPv4 reference

/21 subnet mask (255.255.248.0)

A /21 is the subnet mask 255.255.248.0: 21 network bits and 11 host bits, giving 2,048 addresses and 2,046 usable hosts. Its wildcard mask is 0.0.7.255 and its block size is 8.

Subnet mask
255.255.248.0
Wildcard
0.0.7.255
Addresses
2,048
Usable hosts
2,046
Block size
8

The /21 mask in binary

The prefix is the number of 1 bits at the start of the mask. Ones mark the network part of an address, zeros the host part.

11111111.11111111.11111000.00000000

21 network bits, 11 host bits.

Every /21 in 172.16.0.0/16

A /16 holds 32 /21 subnets, each starting where the previous one ends.

/21 subnets of 172.16.0.0/16
NetworkFirst hostLast hostBroadcast
172.16.0.0/21172.16.0.1172.16.7.254172.16.7.255
172.16.8.0/21172.16.8.1172.16.15.254172.16.15.255
172.16.16.0/21172.16.16.1172.16.23.254172.16.23.255
172.16.24.0/21172.16.24.1172.16.31.254172.16.31.255
172.16.32.0/21172.16.32.1172.16.39.254172.16.39.255
172.16.40.0/21172.16.40.1172.16.47.254172.16.47.255
172.16.48.0/21172.16.48.1172.16.55.254172.16.55.255
172.16.56.0/21172.16.56.1172.16.63.254172.16.63.255
172.16.64.0/21172.16.64.1172.16.71.254172.16.71.255
172.16.72.0/21172.16.72.1172.16.79.254172.16.79.255
172.16.80.0/21172.16.80.1172.16.87.254172.16.87.255
172.16.88.0/21172.16.88.1172.16.95.254172.16.95.255
172.16.96.0/21172.16.96.1172.16.103.254172.16.103.255
172.16.104.0/21172.16.104.1172.16.111.254172.16.111.255
172.16.112.0/21172.16.112.1172.16.119.254172.16.119.255
172.16.120.0/21172.16.120.1172.16.127.254172.16.127.255
172.16.128.0/21172.16.128.1172.16.135.254172.16.135.255
172.16.136.0/21172.16.136.1172.16.143.254172.16.143.255
172.16.144.0/21172.16.144.1172.16.151.254172.16.151.255
172.16.152.0/21172.16.152.1172.16.159.254172.16.159.255
172.16.160.0/21172.16.160.1172.16.167.254172.16.167.255
172.16.168.0/21172.16.168.1172.16.175.254172.16.175.255
172.16.176.0/21172.16.176.1172.16.183.254172.16.183.255
172.16.184.0/21172.16.184.1172.16.191.254172.16.191.255
172.16.192.0/21172.16.192.1172.16.199.254172.16.199.255
172.16.200.0/21172.16.200.1172.16.207.254172.16.207.255
172.16.208.0/21172.16.208.1172.16.215.254172.16.215.255
172.16.216.0/21172.16.216.1172.16.223.254172.16.223.255
172.16.224.0/21172.16.224.1172.16.231.254172.16.231.255
172.16.232.0/21172.16.232.1172.16.239.254172.16.239.255
172.16.240.0/21172.16.240.1172.16.247.254172.16.247.255
172.16.248.0/21172.16.248.1172.16.255.254172.16.255.255

Where a /21 is used

A /21 covers eight consecutive /24 networks, so it is the summary route for a site that has been given eight class C sized blocks.

It is also a common size for a large user or wireless network that has outgrown a /22, at 2,046 usable hosts.

Usable addresses in a /21
WhereUsable addresses
Ordinary network2,046
AWS VPC subnet (5 reserved)2,043
Azure subnet (5 reserved)2,043

Worked example: 172.16.45.9/21

The block-size method, the way you would do it in an exam without a calculator.

  1. /21 means a mask of 255.255.248.0.
  2. The interesting octet is the third one, where the mask is 248. Block size = 256 − 248 = 8.
  3. Subnets in that octet start at multiples of 8. 45 falls in the block from 40 to 47.
  4. Network address = 172.16.40.0; broadcast = the next block minus one = 172.16.47.255.
  5. Usable hosts run from the network plus one to the broadcast minus one: 172.16.40.1 to 172.16.47.254, which is 2^11 − 2 = 2,046 addresses.

Try another address in the subnet calculator, or practise without one on the subnetting practice questions.

/21 subnet mask: your questions

The subnet mask for /21 is 255.255.248.0. The prefix counts the 1 bits in the mask: 11111111.11111111.11111000.00000000 has 21 ones. The wildcard mask, used in Cisco ACLs and OSPF, is 0.0.7.255.

Other prefixes