/30 Subnet Mask

A /30 subnet mask is 255.255.255.252. It has 4 addresses, 2 usable hosts and the wildcard mask 0.0.0.3.

CIDR prefix/30
Subnet mask255.255.255.252
Wildcard mask0.0.0.3
Binary mask11111111.11111111.11111111.11111100
Total addresses4
Usable hosts2
Block size4 (fourth octet)

Example: 192.168.1.0/30

Network address192.168.1.0
First usable host192.168.1.1
Last usable host192.168.1.2
Broadcast address192.168.1.3

Where /30 subnets start

/30 networks start on multiples of 4 in the fourth octet (0, 4, 8, 12, …). A /24 holds 64 /30 subnets, and a /16 holds 16,384.

How to calculate a /30 subnet

  1. Host bits: 32 − 30 = 2.
  2. Total addresses: 22 = 4.
  3. Usable hosts: 4 − 2 = 2, because the network and broadcast addresses can't be assigned to hosts.
  4. Subnet mask: 30 one-bits followed by 2 zero-bits. The fourth octet is 252 (256 − 4), which gives 255.255.255.252.
  5. Wildcard mask: 255.255.255.255 − 255.255.255.252 = 0.0.0.3.

When to use a /30

A /30 gives 2 usable hosts and is the traditional choice for point-to-point links between routers. A /31 (RFC 3021) is the modern alternative that wastes no addresses.

Updated . Calculate any network with the subnet calculator, or compare all prefixes in the subnet cheat sheet.