Tools / cidr / common

How many usable hosts in a /30?

A /30 subnet has 4 IP addresses and 2 usable hosts. The first address is the network address and the last is the broadcast address, so neither can go on a host. Its netmask is 255.255.255.252 and its wildcard mask is 0.0.0.3.

/30 at a glance

Prefix
/30
Netmask
255.255.255.252
Wildcard
0.0.0.3
Addresses
4
Usable hosts
2

Example: 192.168.10.0/30

Network
192.168.10.0
Broadcast
192.168.10.3
Hosts
192.168.10.1 – 192.168.10.2

Usable IPs in a /30 cloud subnet

No major cloud accepts a /30 subnet: AWS stops at /28, Azure and Google Cloud at /29.

ProviderUsable
AWS VPCReserves 5: network, VPC router, DNS, one held for future use, broadcastNot allowed (/16–/28 only)
Azure VNetReserves 5: network, default gateway, two for Azure DNS, broadcastNot allowed (/2–/29 only)
Google Cloud VPCReserves 4: network, default gateway, second-to-last, broadcastNot allowed (/4–/29 only)

/30 or /31?

A /30 is the classic point-to-point link: 4 addresses, 2 usable. On equipment that supports RFC 3021 a /31 does the same job with 2 addresses, so a /30 wastes half its block.

Questions

Quick answers.

Worked out with the same code as the CIDR calculator, which takes any IPv4 block and also splits it and checks overlaps.

What is the subnet mask for a /30?

255.255.255.252. In binary it is 30 ones followed by 2 zeros. The wildcard mask, which Cisco ACLs and OSPF use, is 0.0.0.3.

How many /30 subnets fit in a /24?

64. Each extra prefix bit halves the block, so a /24 (256 addresses) splits into 64 /30 subnets of 4 addresses each.