Skip to content
Tape and Square

N-01 · Subnet · /30

/30 subnet

A /30 network keeps 30 of the 32 address bits for the network and leaves 2 for hosts. Its mask, host count, the blocks it fits in and example networks, all worked out below.

Short answer

Subnet mask
255.255.255.252Wildcard 0.0.0.3
Usable hosts
24 addresses in total

2^2 = 4 addresses. The first is the network address and the last the broadcast, so 2 can go to devices.

The /30 mask in binary and hex

30 one bits, then 2 zero bits. The wildcard is the mask inverted.

MaskDottedHex
Subnet mask255.255.255.252FF.FF.FF.FC
Wildcard0.0.0.300.00.00.03

The mask ends inside the fourth octet, at 252 (11111100). That leaves 2 host bits in the octet, so /30 networks start every 4 in it: 0, 4, 8, 12 and so on. Cisco access lists take the wildcard form, 0.0.0.3, where a 1 bit means “any value” (Cisco document 23602).

RFC 1878's table lists /30 as FF.FF.FF.FC hex, 4 addresses, equal to 1/64 C in the old class terms. Its Table 1-2 counts a /30 as 64 subnets of a class C network with 2 hosts each.

How many /30 subnets fit

The three private ranges (RFC 1918) and one /24.

Block/30 subnets in it
10.0.0.0/84,194,304
172.16.0.0/12262,144
192.168.0.0/1616,384
192.168.181.0/2464

10.0.0.0/8 holds 4,194,304, 172.16.0.0/12 holds 262,144 and 192.168.0.0/16 holds 16,384 /30 subnets. A /24 splits into 64 of them.

Splitting a /30

Each extra prefix bit halves the block.

IntoSubnetsUsable each
/3122
/3241

Splitting a /30 into two /31 point-to-point links gains addresses: the /30 has 2 usable, the two /31s have 4, because RFC 3021 drops the network and broadcast addresses on a /31.

/30 subnets of 192.168.181.0/24

192.168.181.0/24 holds 64 of them. The row in bold holds 192.168.181.150.

SubnetFirst usableLast usable
192.168.181.0/30192.168.181.1192.168.181.2
192.168.181.4/30192.168.181.5192.168.181.6
192.168.181.8/30192.168.181.9192.168.181.10
… 34 more subnets
192.168.181.148/30192.168.181.149192.168.181.150
… 25 more subnets
192.168.181.252/30192.168.181.253192.168.181.254

Check an address

Pre-filled with 192.168.181.150/30. Change the address or the prefix.

/30

Also accepts 192.168.1.130 255.255.255.192, 192.168.1.0 60 hosts or IPv6 like 2001:db8::/48.

Result

192.168.181.148/30

2 usable hosts

Network
192.168.181.148
First usable
192.168.181.149
Last usable
192.168.181.150
Broadcast
192.168.181.151
Subnet mask
255.255.255.252
Wildcard mask
0.0.0.3
Total addresses
4
PRIVATE

Inside 192.168.0.0/16, a private range (RFC 1918). Not routable on the public internet.

Binary view

Address · 192.168.181.150
11000000.10101000.10110101.10010110
Mask · 255.255.255.252
11111111.11111111.11111111.11111100
Network · 192.168.181.148
11000000.10101000.10110101.10010100

Bold bits are fixed for the network; orange bits number the hosts.

192.168.181.0/24 split into /30 · 64 blocks

  1. … 34 before
  2. 192.168.181.148/30.149–.150 ◂
  3. … 22 more

/30 next to /29 and /31

One bit shorter, a /29 (255.255.255.248) has 8 addresses and 6 usable, 4 more than a /30. One bit longer, /31 (255.255.255.254) has 2 addresses and 2 usable. /29 subnet · /31 subnet

Ask the calculator for a host count and it answers /30 for 1 to 2 hosts: typing "192.168.181.148 2 hosts" gives this size, one more host gives a /29.

/30 is the longest prefix that still has a network and a broadcast address. RFC 1122 required at least two host bits, which made /30 the classic size for a two-host point-to-point link, as in Cisco's VLSM example. RFC 3021 later allowed /31 for those links.

Worked example

Take 192.168.181.150/30. The mask ends in the fourth octet. There the address is 150 = 10010110 and the mask 252 = 11111100; AND keeps the first 6 bits: 10010100 = 148. So the network is 192.168.181.148. OR the wildcard 0.0.0.3 onto it to set every host bit: 192.168.181.151, the broadcast.

Devices use 192.168.181.149 through 192.168.181.150: 2 addresses. 192.168.181.150 is number 2 of them. In 192.168.181.0/24 this is subnet 38 of 64.

References

  • RFC 4632, Classless Inter-domain Routing (CIDR), §3.1: prefix lengths and block sizes.
  • RFC 950, Internet Standard Subnetting Procedure: subnet masks.
  • RFC 1878, Variable Length Subnet Table For IPv4, Table 1-2.
  • RFC 1122, Requirements for Internet Hosts, §3.2.1.3: network and broadcast addresses.
  • RFC 3021, Using 31-Bit Prefixes on IPv4 Point-to-Point Links.
  • RFC 1918, Address Allocation for Private Internets: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.

Other prefixes