Guide
Encoding DHCP option 121 routes and option 43 vendor data
A DHCP server gives out more than an address. It can also tell clients about static routes, for example “reach the 192.168.50.0/24 network through this router”, which saves configuring each machine. The format of that option is compact and awkward to write by hand. The page encodes a list of routes into option 121 and shows the lines for common DHCP servers.
How option 121 is built
Each route is encoded as a sequence of bytes. The first byte is the prefix length, from 0 to 32. Then come only the octets of the destination that the prefix covers, rounded up to whole bytes. Then four bytes give the router address. So 192.168.50.0/24 via 10.0.0.1 is the prefix length 24 (18 in hex), three destination octets (c0 a8 32) and the router (0a 00 00 01): 18:c0:a8:32:0a:00:00:01. Routes are simply concatenated. A default route is the prefix length 0, no destination bytes and the router. The standard is RFC 3442.
Entering routes
Type one route per line in the form network/prefix via router, or press Sample. The page validates each line and then prints the option as a colon-separated hex string with its length, followed by configuration lines. For ISC dhcpd it writes option rfc3442-classless-static-routes with decimal values separated by commas; for dnsmasq, a dhcp-option=121,... line with the routes in readable form; and for Cisco IOS and Windows Server a raw hex line. A panel “What a client will install” repeats the routes so you can check what was understood.
Option 43 and decoding
The second tab handles vendor-specific information (option 43). It carries a series of sub-options, each with a code, a length and a value, whose meaning depends on the device vendor; Cisco lightweight access points, for example, look for sub-option 241 containing their controllers’ IPv4 addresses. The third tab decodes a hex string back into routes, which is useful when a capture shows option 121 and you want to know what it does.
Windows and option 249
Windows clients historically use option 249 for classless static routes, while other systems use 121. If you serve both, configure both options with the same data. As the page notes, a client that gets option 121 ignores option 3, the router option, so the default gateway must be part of option 121 as a 0.0.0.0/0 route. Forgetting that leaves the client without a default route, one of the most common problems with this option.
A worked example
The sample has three routes: 192.168.50.0/24 via 10.0.0.1, 10.99.0.0/16 via 10.0.0.254 and 0.0.0.0/0 via 10.0.0.1. The page encodes them as 18:c0:a8:32:0a:00:00:01:10:0a:63:0a:00:00:fe:00:0a:00:00:01, 20 bytes. The dnsmasq line is dhcp-option=121,192.168.50.0/24,10.0.0.1,10.99.0.0/16,10.0.0.254,0.0.0.0/0,10.0.0.1, and the raw line is option 121 hex 18c0a8320a000001100a630a0000fe000a000001. Note that the /16 route has only two destination octets (0a 63).
Limits
Only options 121 and 43 are covered, and the option 43 sub-options are generic because their meaning depends on the vendor. Syntax differs between DHCP servers and versions, so test the generated line on one client first. The total option length is limited to 255 bytes, so a very long route list may need splitting across servers or a different approach.
Related tools
- Hex to Binary Converter helps when you decode option bytes by hand.
- Subnet Calculator checks the networks you put into routes.
- Route Summarization Calculator reduces a long list of routes.
- Packet Header Decoder reads the UDP and IP layers that carry DHCP.
Checked against the current version of the DHCP Option Encoder on .

