Find Network for /30

Intermediate Identify

Question

Given the IP address 192.168.100.5 with a /30 prefix length, identify the network address, broadcast address, first usable host, last usable host, and total number of usable hosts.

Given

{
  "ip": "192.168.100.5",
  "prefix": 30
}

Answer

{
  "network": "192.168.100.4",
  "broadcast": "192.168.100.7",
  "first_host": "192.168.100.5",
  "last_host": "192.168.100.6",
  "host_count": 2
}

Try to solve it first, then click Reveal Answer

Step-by-Step Explanation

Step 1: Convert /30 to a subnet mask

30 network bits, 2 host bits:

Binary:      11111111.11111111.11111111.11111100
Decimal:     255      .255     .255     .252

Step 2: Find the block size

Block size = 256 − 252 = 4.

Network boundaries in the last octet: 0, 4, 4, 8, 12, ...

Step 3: Locate 192.168.100.5 in the correct block

5 ÷ 4 = 1.25 → floor to 1 → block start = 1 × 4 = 4.

The network address is 192.168.100.4, covering addresses .4 through .7.

Binary verification:

IP address:    192.168.100.  5  →  11000000.10101000.01100100.00000101
Subnet mask:   255.255.255.252  →  11111111.11111111.11111111.11111100
                               AND ─────────────────────────────────────
Network:       192.168.100.  4  →  11000000.10101000.01100100.00000100

Step 4: Broadcast and host range

Set 2 host bits to 1:

Network:  192.168.100.4  →  ...00000100
Host = 1:                →  ...00000111
Broadcast: 192.168.100.7
  • First host: 192.168.100.5
  • Last host: 192.168.100.6
  • Usable hosts: 2^2 − 2 = 4 − 2 = 2

/30 subnets are the standard choice for point-to-point WAN links between routers where only two addresses are needed. If using RFC 3021, a /31 can also be used.

Summary

Field Value
Network 192.168.100.4
Broadcast 192.168.100.7
First host 192.168.100.5
Last host 192.168.100.6
Usable hosts 2

Related Terms

More Identify Worksheets