EdgeRouter - Custom DHCP Server Options


Readers will learn how to add custom options to the DHCP server configuration.

Applicable to the latest EdgeOS firmware on all EdgeRouter models. Please see the Related Articles below for more information.
Device used in this article:

Add a DHCP Option

Back to Top

Four settings are required when configuring a DHCP server: 

  • name The name of the DHCP scope (LAN).
  • subnet The subnet range (
  • option <name/number> The DHCP option (Default Gateway, DNS, etc).
  • option <string> The value given to the DHCP option.

Below is an example on how to add option 242 to an existing DHCP configuration. The ISC documentation here includes many more available options.

CLI: Access the command line interface. You can do this using the CLI button in the GUI or by using a program such as PuTTY.

1. Enter configuration mode.


2. Add the DHCP option 242.

set service dhcp-server global-parameters 'option option-242 code 242 = string;'
set service dhcp-server shared-network-name LAN subnet subnet-parameters 'option option-242 &quot;L2Q=1,L2QVLAN=118&quot;;'

3. Commit the changes and save the configuration.

commit ; save 
NOTE: The actual value of this DHCP option is option option-242 "L2Q=1,L2QVLAN=118";
The &quot; value is used to replace the quotation marks (") to allow a part of the string to be quoted inside the single quote (') section.

Related Articles

Back to Top

Intro to Networking - How to Establish a Connection Using SSH

EdgeRouter - DHCP Server Using Dnsmasq

EdgeRouter - UniFi Controller DHCP Options

EdgeRouter - DHCP Relay

EdgeRouter - DHCP Server

We're sorry to hear that!