What it does
The subnet calculator takes one IPv4 or IPv6 address with its prefix and shows the network it belongs to: the network and broadcast addresses, the range of host addresses, the masks, how many hosts fit, and the reverse DNS zone that covers it.
When to use it
- Planning an addressing scheme: checking that a VLAN's prefix holds the devices it must serve.
- Checking a device's settings: whether an address, mask and gateway sit in the same network.
- Writing firewall rules or ACLs: the wildcard mask for a network.
- Delegating reverse DNS: the zone a network's PTR records live in.
Entering an address
Type an address and its prefix in any of these forms, then Calculate:
| You type | Means |
|---|---|
192.168.1.10/24 |
Address with a prefix length |
192.168.1.10 255.255.255.0 |
Address with a dotted netmask |
10.0.0.0/8 |
A network address |
2001:db8::1/64 |
An IPv6 address with its prefix |
192.168.1.10 |
A single host: /32 for IPv4, /128 for IPv6 |
The result has its own link, such as /ip/subnet/192.168.1.10/24, which you can bookmark or
send to someone.
Reading the result
- Network: the first address of the block, with its prefix. This is what routes and firewall rules name.
- Netmask and wildcard mask: the prefix written as a dotted mask, and its inverse (used by Cisco ACLs and OSPF network statements).
- Broadcast: the last address of an IPv4 block. IPv6 has no broadcast.
- Host range and usable hosts: the addresses you can give devices. In IPv4 the network and broadcast addresses are left out, except in a /31 (a point-to-point link, RFC 3021) and a /32. In IPv6 every address in the prefix counts.
- Reverse DNS zone: the smallest
in-addr.arpaorip6.arpazone that covers the whole network. A prefix that isn't on an octet (IPv4) or nibble (IPv6) boundary needs the larger zone shown, or classless delegation (RFC 2317). - Type: private (RFC 1918 or a unique local IPv6 address), public, loopback, link-local, multicast or reserved.
Worked example
A floor switch needs a VLAN for up to 50 access points. Try
192.168.10.37/26:
- the network is
192.168.10.0/26with mask255.255.255.192; - hosts run from
192.168.10.1to192.168.10.62, which is 62 usable addresses, enough for 50 access points plus the gateway and room to grow; - the broadcast is
192.168.10.63, so the next /26 starts at192.168.10.64; - reverse DNS for these hosts lives in
10.168.192.in-addr.arpa.
Common mistakes
- Counting the network and broadcast as hosts. A /24 holds 254 devices, not 256.
- Forgetting the gateway. It takes one of the usable addresses.
- Subnetting IPv6 smaller than /64 for a LAN. SLAAC and many other features expect a /64.
- Using a non-octet IPv4 prefix for reverse DNS without asking the zone's owner for classless delegation.