/18 Subnet: Mask 255.255.192.0

A /18 is a quarter of a /16. The third octet moves in steps of 64: 0, 64, 128, 192. That makes it the natural size when you split a VPC evenly across Availability Zones.

/18 at a glance

Subnet mask
255.255.192.0
Wildcard mask
0.0.63.255
Usable hosts
16,382
Total addresses
16,384 (214)
Block size (third octet)
64
Network / host bits
18 / 14
Mask in hex
0xFFFFC000

Mask in binary: 11111111.11111111.11000000.00000000

Network bits Host bits

Try it: which /18 is an address in?

Network address
10.0.128.0/18
First usable host
10.0.128.1
Last usable host
10.0.191.254
Broadcast address
10.0.191.255
Next /18 starts at
10.0.192.0

How many /18 networks fit

How /18 relates to /8, /16 and /24 blocks
Parent block Relationship
/8 1,024 × /18 fit inside one /8
/16 4 × /18 fit inside one /16
/24 One /18 covers 64 × /24

A /18 holds 64 × /24 or 4 × /20.

Worked example: 10.0.150.77/18

A VPC 10.0.0.0/16 was cut into four /18s, one per AZ. A pod at 10.0.150.77 has a routing problem. Which AZ block does it belong to?

  1. The mask is 255.255.192.0. The third octet (192) is the "interesting" one — the first that is not 255.
  2. Block size = 256 − 192 = 64. Networks start at multiples of 64 in the third octet: 0, 64, 128, …
  3. The third octet of 10.0.150.77 is 150. 150 ÷ 64 = 2 remainder 22, so the block starts at 2 × 64 = 128.
  4. Network = 10.0.128.0 (octets after the third become 0). Broadcast = 128 + 64 − 1 = 191, giving 10.0.191.255 (octets after it become 255).
  5. Usable hosts: 10.0.128.1 to 10.0.191.254, which is 214 − 2 = 16,382 addresses.

Same thing in binary (network bits | host bits):

Address  00001010.00000000.10|010110.01001101
Mask     11111111.11111111.11|000000.00000000
Network  00001010.00000000.10|000000.00000000

Where /18 is used in real networks

  • One /18 per Availability Zone

    Split a /16 VPC into four /18s and give each AZ one. Inside each, carve public and private subnets. Three AZs leave the fourth /18 free for later. The EKS multi-AZ splitter does this layout for you.

  • Large EKS private subnets

    With the AWS VPC CNI every pod takes a real VPC IP, so EKS private subnets need to be big. A /18 per AZ gives over 16,000 pod and node IPs per zone.

Common /18 mistakes

  • Writing 10.0.100.0/18. The third octet of a /18 must be 0, 64, 128 or 192, so it becomes 10.0.64.0/18.
  • Working out the broadcast as 10.0.192.255 for 10.0.128.0/18. The block runs 64 values in the third octet, so the last address is 10.0.191.255.

/18 FAQ

How many hosts are in a /18?

16,382 usable: 2^14 = 16,384 addresses minus network and broadcast.

How many /18s fit in a /16?

Four, because a /18 uses 2 more network bits than a /16 and 2^2 = 4. In 10.0.0.0/16 they start at 10.0.0.0, 10.0.64.0, 10.0.128.0 and 10.0.192.0.

What is the block size of a /18?

64 in the third octet, because the mask's third octet is 192 and 256 − 192 = 64.

Related tools