DHCP option 43, 119 and 121 encoder and decoder
Build the hex value of a DHCP option, or paste one to read it: option 121 and 249 classless static routes, option 119 domain search lists, and option 43 vendor sub-options such as the controller addresses of Cisco and UniFi access points. It works in your browser.
Option 121 and 249: classless static routes
Enter one route per line: the network with its prefix length, then the router, such as 10.0.0.0/8 192.168.1.1. A line may also read 10.0.0.0 255.0.0.0 192.168.1.1, and default stands for 0.0.0.0/0. Or paste the value of the option in hex to read its routes.
Each route is the prefix length in one byte, then only as many bytes of the network as the prefix covers, then the four bytes of the router. Option 249, Microsoft's classless static route option, has exactly the same format, so the same hex works for both.
Two rules catch people out. When a client uses option 121, it must ignore option 3, the router option: put the default route, 0.0.0.0/0, into option 121 as well. And Windows XP and Windows Server 2003 use only option 249 and ignore 121; later Windows clients ask for both.
The examples of RFC 3442:
| Network | Mask | Destination descriptor | Hex |
|---|---|---|---|
0.0.0.0/0 | 0.0.0.0 | 0 | 00 |
10.0.0.0/8 | 255.0.0.0 | 8.10 | 080a |
10.0.0.0/24 | 255.255.255.0 | 24.10.0.0 | 180a0000 |
10.17.0.0/16 | 255.255.0.0 | 16.10.17 | 100a11 |
10.27.129.0/24 | 255.255.255.0 | 24.10.27.129 | 180a1b81 |
10.229.0.128/25 | 255.255.255.128 | 25.10.229.0.128 | 190ae50080 |
10.198.122.47/32 | 255.255.255.255 | 32.10.198.122.47 | 200ac67a2f |
Option 119: domain search list
Enter the domain suffixes a client should try, separated by spaces, commas or new lines. The page encodes them the way RFC 3397 asks: each name as labels, a length byte before each label, and a name that ends like an earlier one points back to it. Or paste the hex to read the names.
A list longer than 255 bytes goes into several option 119 entries that the client joins together. The DHCP client of Windows reads option 119 from Windows 10, version 1803 on.
The example of RFC 3397:
| Domains | Hex | Bytes |
|---|---|---|
| eng.apple.com marketing.apple.com | 03656e67056170706c6503636f6d00096d61726b6574696e67c004 | 27 |
Option 43: vendor-specific information
Option 43 carries what the vendor of a device defines, usually as sub-options: a code byte, a length byte, then the value. What the bytes mean is up to the vendor whose class the device sends in option 60. Pick a vendor and enter the addresses, or enter sub-options one per line as code and value, such as 241 192.168.10.5 192.168.10.20. A value is read as IPv4 addresses, as hex after 0x, or else as text. Or paste the hex to read its sub-options.
The formats the vendors publish:
| Devices | Sub-option | Value | Example | Hex |
|---|---|---|---|---|
| Cisco lightweight access points | 241 (0xf1) | The management addresses of the wireless LAN controllers, four bytes each. Cisco IOS takes it as option 43 hex and the string. | 192.168.10.5 192.168.10.20 | f108c0a80a05c0a80a14 |
| UniFi devices | 1 | The address of the UniFi Network application, four bytes. | 192.168.3.10 | 0104c0a8030a |
| UniFi devices | 1 and 2 | Sub-option 2 is the inform URL in ASCII, such as http://192.168.3.10:8080/inform. Both may be sent together. | 192.168.3.10 http://192.168.3.10:8080/inform | 0104c0a8030a021f687474703a2f2f3139322e3136382e332e31303a383038302f696e666f726d |
Sources
- Option 121: RFC 3442, The Classless Static Route Option for DHCPv4. Option 249 and how Windows uses 121 and 249: Microsoft's DHCP extensions specification, [MS-DHCPE], section 2.2.8.
- Option 119: RFC 3397, the Domain Search Option, with the name compression of RFC 1035. Windows support: Microsoft's page What's New in DHCP.
- Option 43: RFC 2132, section 8.4. Cisco's page on DHCP option 43 for lightweight access points, and Ubiquiti's page on remote adoption (layer 3).
More Network tools
-
CIDR subnet calculator
Network, broadcast, host range, subnet mask and wildcard mask for IPv4 and IPv6 prefixes.
-
IP range to CIDR converter
Turn a range such as 10.0.0.5-10.0.0.70 into CIDR blocks, merge a list of blocks, and check whether an address is in it.
-
IP address type checker
See whether an address is private, CGNAT, link-local, loopback, documentation, multicast or public, with its RFC.
-
IPv6 expander, compressor and reverse name
Write an IPv6 address in full or in its shortest form, get its ip6.arpa name, or build one from a MAC address.
-
MAC address format converter
Convert MAC addresses between colons, dashes, Cisco's dotted form and plain hex, and read the multicast and local bits.
-
MTU and MSS calculator
Work out the MTU and TCP MSS inside PPPoE, GRE, VXLAN, WireGuard and IPsec, with ping commands that test them.
-
Port number lookup
Look up a port such as 445 or 5985, or a service name, in IANA's registry, with what Windows and Active Directory use it for.
-
NPS reason code lookup
Read why Network Policy Server denied a request: events 6273 and 6274, and reason codes such as 16, 48 and 65.
-
Wi-Fi reason and status codes
Look up 802.11 deauthentication and disassociation reason codes and association status codes.
-
DSCP and ToS converter
Convert DSCP, ToS and CoS values, with the Wi-Fi priorities of RFC 8325 and the Teams QoS markings.