DHCP Classless Static Route Encoder

Turn a list of CIDR routes into the DHCP option 121 payload a server hands to its clients, or read an existing payload back into routes.

One route per line: destination/prefix and next hop, for example 10.0.0.0/8 192.168.1.1.

Enter one route per line to build its option payload.

Option 121 (0x79) carries a list of routes. Each one is a single octet holding the subnet-mask width in bits, then only the significant octets of the destination — width ÷ 8 rounded up, so a /8 keeps one octet and a /24 keeps three — then four octets of router address. A width of 0 with no destination octets is the default route, and a router of 0.0.0.0 marks another subnet on the same link, which a client that cannot install such a route must ignore. Destination bits beyond the width are zeroed by the client, so this page writes the network address and says when it had to. A client that supports option 121 ignores the Router option, so include your default route here as well. The option data is limited to 255 bytes because its length is one octet; RFC 3396 concatenation has to split anything longer. Option 249 (0xF9) is Microsoft's private copy of the same encoding. Everything runs in your browser, with no storage and no network access.