# set dhcp relay

#### Syntax

To create the DHCP relay independent of any DHCP servers and to explicitly delete the DHCP server

[ no ] set dhcp relay

To create and disable the DHCP relay for a specific DHCP server

set dhcp relay { dhcpServerAddress [ proxy ] | agent [ circuit-ID-only |
remote-ID-only ] |inhibit-access-route-creation | discard-access-routes
{ all | interfaceType interfaceSpecifier | | unknown } }

no set dhcp relay { dhcpServerAddress | agent | inhibit-access-route-creation }

#### Release Information

Command introduced before JunosE Release 7.1.0.
Command used without any keywords introduced in JunosE Release 8.2.0.
unknown keyword added in JunosE Release 9.2.0.

#### Description

When used without any optional keywords, creates and enables DHCP relay in the current virtual router independent of any DHCP servers.

When used with optional keywords, adds a new DHCP/BOOTP server and specifies that the E Series router is either a DHCP relay or DHCP relay proxy between the DHCP client and DHCP server. Optionally, configures the DHCP relay agent, including specifying the DHCP relay agent information (option 82) that is included in all packets forwarded to the DHCP server.

If you issue the set dhcp relay command when a local server has been configured, the local server is deactivated.

The no version used without other keywords deletes the DHCP relay agent and its configuration from the virtual route. The no version used with optional keywords removes the specified server or disables the specified relay agent configuration.

| Note: The set dhcp relay agent command, when used to configure option 82 suboptions, is a legacy command, which JunosE Software continues to support to provide backward-compatibility for existing scripts. We recommend that you use the dhcp relay agent sub-option command for new option 82 suboption configurations.

#### Options

- dhcpServerAddress—IP address of the DHCP server
- proxy—Specifies that the router is a DHCP relay proxy between the DHCP client and DHCP server; if omitted, the router functions as a DHCP server
- agent—Adds the agent information suboptions (circuit-ID and remote-ID) to every packet the router relays from a DHCP client to a DHCP server
- circuit-ID-only—Specifies circuit ID suboption (suboption 1) only
- remote-ID-only—Specifies remote-ID suboption (suboption 2) only
- inhibit-access-route-creation—Specifies that host routes are not installed; enforces consistent state of route/client database
  - In relay mode, removes all installed host routes from IP; deletes all host routes data in the routing table and NVS; stops accumulating host route information
  - In relay proxy mode, removes all installed host routes from IP; deletes all NVS client data and stops installing host routes for newly bound clients in IP; preserves the routing table client data and continues preservation of newly bound clients in the routing table
- discard-access-routes—Removes existing access routes from the routing table and from NVS
- all—Removes all existing access routes
- interfaceType—Interface type whose access routes should be discarded; see Interface Types and Specifiers
- interfaceSpecifier—Particular interface; format varies according to interface type; see Interface Types and Specifiers
- unknown—Removes existing host routes from unknown (nonexistent) interfaces—dynamic interfaces for which DHCP relay retains route information after these interfaces have been deleted

#### Mode

Global Configuration