EdgeRouter - Custom DHCP Server Options
Overview
Readers will learn how to add custom options to the DHCP server configuration.
NOTES & REQUIREMENTS:
- Applicable to the latest EdgeOS firmware on all EdgeRouter models.
Add a DHCP Option
Four settings are required when configuring a DHCP server:
-
name
The name of the DHCP scope (LAN). -
subnet
The subnet range (192.168.1.0/24). -
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 manual page 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.
configure
2. Add the DHCP option, in this case option 242.
set service dhcp-server global-parameters 'option option-242 code 242 = string;'
set service dhcp-server shared-network-name LAN subnet 192.168.1.0/24 subnet-parameters 'option option-242 "L2Q=1,L2QVLAN=118";'
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 " value is used to replace the quotation marks (") to allow a part of the string to be quoted inside the single quote (') section.
The " 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
Intro to Networking - How to Establish a Connection Using SSH
EdgeRouter - DHCP Server Using Dnsmasq