You can configure extended DHCP relay options on the router and enable the router to function as a DHCP relay agent. A DHCP relay agent forwards DHCP request and reply packets between a DHCP client and a DHCP server. You can use DHCP relay in carrier edge applications such as video/IPTV to obtain configuration parameters, including an IP address, for your subscribers.
To configure the extended DHCP relay agent on the router, include the dhcp-relay statement:
-
dhcp-relay {
-
-
traceoptions {
- flag all;
- flag auth;
- flag database;
- flag state;
- flag interface;
- flag rtsock;
- flag packet;
- flag packet-option;
- flag io;
- flag ha;
- flag ui;
- flag general;
- flag fwd;
- flag rpd;
- flag session-db;
-
- file file-name {
- <files number>;
- <size maximum-file-size>;
- <match regex>;
- <(world-readable | no-world-readable)>;
- }
- }
-
-
overrides {
-
always-write-giaddr;
-
always-write-option-82;
-
layer2-unicast-replies;
-
trust-option-82;
-
disable-relay;
- }
-
-
relay-option-60 {
-
-
vendor-option {
-
- (equals | starts-with) (ascii match-string | hexadecimal match-hex) {
- (relay-server-group server-group-name | local-server-group local-server-group-name | drop);
- }
- (default-relay-server-group server-group-name | default-local-server-group local-server-group-name | drop);
- }
- }
-
-
relay-option-82 {
-
-
circuit-id {
-
prefix host-name logical-system-name
routing-instance-name;
- }
- }
-
-
server-group {
-
-
server-group-name {
-
server-ip-address;
- }
- }
-
-
active-server-group server-group-name;
-
-
authentication {
-
password password-string;
-
-
username-include {
-
circuit-type;
-
delimiter delimiter-character;
-
domain-name domain-name-string;
-
logical-system-name;
-
mac-address;
-
option-60;
-
option-82 [circuit-id]
[remote-id];
-
routing-instance-name;
-
user-prefix user-prefix-string;
- }
- }
-
-
group group-name {
-
-
active-server-group server-group-name;
-
-
authentication {
-
password password-string;
-
-
username-include {
-
circuit-type;
-
delimiter delimiter-character;
-
domain-name domain-name-string;
-
logical-system-name;
-
mac-address;
-
option-60;
-
option-82 [circuit-id]
[remote-id];
-
routing-instance-name;
-
user-prefix user-prefix-string;
- }
- }
-
-
overrides {
-
always-write-giaddr;
-
always-write-option-82;
-
layer2-unicast-replies;
-
trust-option-82;
-
disable-relay;
- }
-
-
relay-option-60 {
-
-
vendor-option {
-
- (equals | starts-with) (ascii match-string | hexadecimal match-hex) {
- (relay-server-group server-group-name | local-server-group local-server-group-name | drop);
- }
- (default-relay-server-group server-group-name | default-local-server-group local-server-group-name | drop);
- }
- }
-
-
relay-option-82 {
-
-
circuit-id {
-
prefix host-name logical-system-name
routing-instance-name;
- }
- }
-
- [interface [upto upto-interface-name] [exclude];
- }
- }
You can include these statements at the following hierarchy levels:
For more information about how to use the DHCP relay agent in a video/IPTV application, see the JUNOS Multiplay Solutions Guide.
![]() |
Note: The extended DHCP relay agent options configured with the dhcp-relay statement are incompatible with the DHCP/BOOTP relay agent options configured with the bootp statement. As a result, you cannot enable both the extended DHCP relay agent and the DHCP/BOOTP relay agent on the router at the same time. For information about the DHCP/BOOTP relay agent, see Configuring the Router or Interface to Act as a DHCP/BOOTP Relay Agent. |
The following sections describe the operation and configuration of the extended DHCP relay agent and provide simple and complex configuration examples: