Skip to content

Dynamic DHCP Router Option 3

Grendel's built in DHCP server can be configured to dynamically set DHCP router option 3. This can be useful in situations where network configurations are consistent across many racks of nodes.

For example, suppose Grendel is being used to provision 3 racks of compute nodes. Each rack is setup on it's own /24 subnet:

  • rack1 =
  • rack2 =
  • rack3 =

Additionally, each network is setup in a consistent way where the routers are the same IP address within the network. Suppose the router IP's for each network are:

  • rack1 =
  • rack2 =
  • rack3 =

Out of the box, Grendel serves static DHCP leases for any hosts defined in the database. Using the IP address of the compute node, we can dynamically set the router by setting the last octet to 254. Unlike other DHCP servers there's no need to define subnet definitions or any other configurations.

To configure Grendel to dynamicaly set router option 3 when serving static leases add the following to grendel.toml:

router_octet4 = 254
netmask = 24

Where router_octet4 is the last octet of the router IP address and netmask is the netmask.


Currently only /24 subnets are supported

With the above configuration, when Grendel serves a static DHCP lease for compute node with IP address it will set router option 3 to in the DHCP respose.