A /23 has the netmask 255.255.254.0 and holds 512 addresses, 510 of them usable hosts. It’s two /24s joined: 192.168.0.0/23 runs from 192.168.0.0 to 192.168.1.255, with one network address at the start and one broadcast address at the end, and nothing reserved in between.
The numbers
Network 192.168.0.0/23
Broadcast 192.168.1.255
Netmask 255.255.254.0
Wildcard 0.0.1.255
First host 192.168.0.1
Last host 192.168.1.254
How it fits
A /22 holds two /23s and a /16 holds 128. A /23 splits into 2 /24s or 4 /25s.
Where you’ll see it
A common reason is a /24 LAN that ran out of addresses. Changing the mask from 255.255.255.0 to 255.255.254.0 on the router, the DHCP scope and any statically configured hosts doubles the network without renumbering anything already on it. The new half is fixed, though: 192.168.1.0/24 can only grow into 192.168.0.0/23, so 192.168.0.0/24 has to be free. In the cloud, a /23 subnet leaves 507 usable addresses on AWS or Azure and 508 on Google Cloud.
Gotchas
- Only an even third octet starts a /23.
192.168.0.0/24and192.168.1.0/24make192.168.0.0/23.192.168.1.0/24and192.168.2.0/24don’t make any /23:192.168.1.0/23has host bits set and normalizes to192.168.0.0/23, while192.168.2.0/23is192.168.2.0to192.168.3.255. - The middle addresses are hosts.
192.168.0.255and192.168.1.0look like a broadcast and a network address, but in a /23 they’re ordinary hosts; the tool below confirms192.168.1.0is inside. A DHCP server can hand them out. - Every host needs the new mask. A host left on
/24treats the other half as a different network and sends that traffic to the gateway instead of straight across the LAN. Change the static hosts along with the router and the DHCP scope.
In your stack
# Terraform: the second /23 of 192.168.0.0/16, and the upper /24 of a /23
cidrsubnet("192.168.0.0/16", 7, 1) # "192.168.2.0/23"
cidrsubnet("10.0.0.0/23", 1, 1) # "10.0.1.0/24"
import ipaddress
ipaddress.ip_network("192.168.1.0/23") # ValueError: 192.168.1.0/23 has host bits set
ipaddress.ip_network("192.168.1.0/23", strict=False) # IPv4Network('192.168.0.0/23')
# dnsmasq: one pool across both halves
dhcp-range=192.168.0.50,192.168.1.250,255.255.254.0,12h