Skip to content
Illinois License # 127.001891Lincolnshire, ILinfo@meridianalarm.com

Tools and resources

IP subnet and CIDR calculator

Work out what a prefix actually gives you: the usable range, the mask, how many devices fit, and how to carve a block up for separate systems.

A prefix length or a mask: 192.168.10.0/24 and 192.168.10.0/255.255.255.0 both work, and any address inside the block will do — it will tell you the network.

A worked example

192.168.10.0/24. The /24 leaves 8 bits for the host part, so the block holds 256 addresses from 192.168.10.0 to 192.168.10.255. The first is the network address and the last is the broadcast, neither of which goes on a device, so 254 are usable: 192.168.10.1 – 192.168.10.254. The mask is 255.255.255.0, and the wildcard an access list wants is 0.0.0.255.

That is the calculation. Everything else on this page is about the decisions it feeds.

Being handed a range for the cameras

This is the usual shape of the job: the client's IT department gives you a block and you have to fit the system into it. 60 cameras need 60 addresses, plus the recorder, plus whatever else sits on that network, and the smallest prefix that holds 60 is a /26 with 62 usable. That is not much headroom, and a system that grows by eight cameras is then a re-addressing job rather than an install.

The other direction is worth checking before you accept a block. A /24 is 254 usable addresses — generous for cameras, and nowhere near enough for a large access control system with a reader and a controller on every door, which is the kind of thing worth saying before the cable goes in rather than after.

Carving a block up

Cameras, access control, intercom and the client's own computers do not want to share a broadcast domain, and keeping them apart is as much a security measure as a performance one: a camera network that cannot reach the finance department is one less path in.

A 10.20.0.0/22 splits into 4 /24 blocks of 254 usable addresses each, which is a workable shape for a mid-size building:

  • 10.20.0.0/24 — 10.20.0.1 – 10.20.0.254 — cameras, say
  • 10.20.1.0/24 — 10.20.1.1 – 10.20.1.254 — access control
  • 10.20.2.0/24 — 10.20.2.1 – 10.20.2.254 — intercom and audio
  • 10.20.3.0/24 — 10.20.3.1 – 10.20.3.254 — spare, which is the point of planning it

The split is exact: each block begins where the last one ended, and together they cover the parent with no gap and no overlap. There is a fixture asserting that.

The two prefixes that trip calculators up

Usable addresses are normally the block size minus two, for the network and broadcast addresses. At the short end that formula breaks, and a surprising number of calculators report the broken answer:

  • /30 — 4 addresses, 2 usable (10.255.255.1 – 10.255.255.2). The traditional point-to-point link.
  • /31 — 2 addresses and 2 usable, not zero. With only two ends there is no broadcast address to reserve, which RFC 3021 makes explicit. Minus two would give 0.
  • /32 — one address. A host route or a loopback, not a subnet with a range. Minus two would give −1.

Private, public, and the one that means something broke

Which block you have been given matters as much as its size:

  • 10.0.0.0/8 — Private (RFC 1918). Routable only inside the site.
  • 172.16.0.0/12 — Private (RFC 1918). Routable only inside the site.
  • 192.168.0.0/16 — Private (RFC 1918). Routable only inside the site.
  • 100.64.0.0/10 — Carrier NAT (RFC 6598). Not yours to assign; an ISP uses this.
  • 169.254.0.0/16 — Link-local (RFC 3927). A device that failed to get an address from DHCP.
  • 127.0.0.0/8 — Loopback. Never leaves the device.
  • 224.0.0.0/4 — Multicast. Not host addresses.
  • 0.0.0.0/8 — This network. Not a usable host address.

A camera that has given itself a 169.254 address has not got one from DHCP, which on a new install usually means the wrong VLAN on the port rather than a faulty camera. The calculator above names the range for whatever you give it.

Prefix reference

Every prefix from /8 to /32, with what it holds. Shorter prefixes exist but are route aggregation rather than a network anyone plugs a device into.

IPv4 prefix lengths with mask, block size and usable hosts
PrefixMaskWildcardAddressesUsable
/8255.0.0.00.255.255.25516,777,21616,777,214
/9255.128.0.00.127.255.2558,388,6088,388,606
/10255.192.0.00.63.255.2554,194,3044,194,302
/11255.224.0.00.31.255.2552,097,1522,097,150
/12255.240.0.00.15.255.2551,048,5761,048,574
/13255.248.0.00.7.255.255524,288524,286
/14255.252.0.00.3.255.255262,144262,142
/15255.254.0.00.1.255.255131,072131,070
/16255.255.0.00.0.255.25565,53665,534
/17255.255.128.00.0.127.25532,76832,766
/18255.255.192.00.0.63.25516,38416,382
/19255.255.224.00.0.31.2558,1928,190
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

What this does not tell you

  • IPv4 only. IPv6 subnetting is a different exercise with different conventions, and camera, access control and intercom networks are overwhelmingly v4. Pretending to cover both would be worse than saying so.
  • It says nothing about whether a block is free. Overlapping an existing subnet is a conversation with whoever runs the network, not an arithmetic problem.
  • Nothing about VLANs as such. A subnet is addressing and a VLAN is a broadcast domain; they usually map one to one by convention rather than by necessity.
  • Nothing about routing, DHCP scopes, or what the gateway should be. By convention the gateway is the first or last usable address, but that is a local decision and this does not assume one.
  • The reserved ranges listed are the common ones, not every assignment IANA has made.

The network the cameras sit on

Addressing is the easy half. What that network has to carry is the camera bandwidth, what the switch has to power is the PoE budget, and what the recorder has to hold is the storage. Those three decide more installs than the subnet does.

Sources

The arithmetic is the definition of a prefix and needs no source. Two conventions are cited by document rather than stated from memory: the private ranges are RFC 1918, and the two usable addresses on a /31 point-to-point link are RFC 3021. Link-local is RFC 3927 and carrier-grade NAT is RFC 6598.

Full notes and the fixtures: docs/ip-subnet.md in the site's repository.

Working with a client's IT department?

We design camera and access networks to sit alongside an existing one rather than fight it, and we are used to being handed a VLAN and a range and asked to make it work.

Other tools

Free consultation

Tell us about the property and what it needs.

We will look at the building, the risks and the way it is used, then quote a system that fits. No charge for the conversation.

Call nowRequest a quote