DHCP Relay
Juniper Cloud-Native Router can relay DHCP messages between cascaded Next-Generation Distributed Units (NGDUs) and an external DHCP server.
Juniper Cloud-Native Router can be configured as a Stateless DHCP Relay agent for an L2-L3 deployment. It can relay DHCP messages between cascaded Next-Generation Distributed Units (NGDUs) and an external DHCP server. It supports simple packet forwarding non-snooping DHCPv4 and DHCPv6 relay feature between the DHCP client and DHCP server. It does not maintain leases or client state. When configured as a DHCPv4 relay agent, Cloud-Native Router is bypassed for subsequent lease renewals, once the client has obtained its address and configuration from the DHCP server. You can configure the same behavior for DHCPv6 implementation as well. In the forward-only implementation, the relay agent does not participate in the state exchange between the client and server. Hence, events such as reboot, Graceful Routing Engine switchover (GRES), or failover can quickly self-correct as the clients retry interrupted transactions.
Configuration
The following table lists the knobs and overrides that are supported for DHCPv4 and DHCPv6 relay options on Cloud-Native Router:
Protocol |
Supported Knobs |
Supported Overrides |
---|---|---|
DHCPv4 |
forward-only; relay-option-82 |
always-write-option-82 (circuit-id | remote-id); relay-source; trust-option-82; user-defined-option-82 string |
DHCPv6 |
forward-only; relay-agent-interface-id relay-agent-remote-id |
No DHPCv6 overrides supported |
The configuration syntax for DHCPv4 relay agent is provided below. You can configure DHCPv4
relay agent under the [edit]
and [edit routing-instances]
hierarchy. Please review DHCP Relay CLI for command description and
options.
[edit] forwarding-options { dhcp-relay { active-server-group name; duplicate-clients-in-subnet (incoming-interface | option-82); forward-only; overrides { always-write-option-82 (circuit-id | remote-id); relay-source; trust-option-82; user-defined-option-82 string } relay-option-82 { circuit-id { prefix { host-name; logical-system-name; routing-instance-name; } use-interface-description (device | logical); user-defined; } remote-id { prefix { host-name; logical-system-name; routing-instance-name; } use-interface-description (device | logical); } } server-group name { ip-address; } group name { relay-option-82 { circuit-id { prefix { host-name; logical-system-name; routing-instance-name; } use-interface-description (device | logical); user-defined; } remote-id { prefix { host-name; logical-system-name; routing-instance-name; } use-interface-description (device | logical); } } active-server-group name; interface interface_name; } } }
If a packet arrives with an option-82
record and
trust-option-82
is not configured the packet will be dropped.
If a packet arrives with an option-82
record while
relay-option-82
is configured, the original incoming
option-82
value is preserved with no changes.
The configuration syntax for DHCPv6 relay agent is provided below. You can configure DHCPv4
relay agent under the [edit]
and [edit routing-instances]
hierarchy. Please review DHCPv6 Relay CLI for command description and options.
[edit] forwarding-options { dhcp-relay { dhcpv6 { active-server-group name; forward-only; relay-agent-interface-id { prefix { host-name; logical-system-name; routing-instance-name; } use-interface-description (device | logical); } relay-agent-remote-id { prefix { host-name; logical-system-name; routing-instance-name; } use-interface-description (device | logical); } server-group <name> { ip-address; } group name { relay-agent-interface-id { prefix { host-name; logical-system-name; routing-instance-name; } use-interface-description (device | logical); } relay-agent-remote-id { prefix { host-name; logical-system-name; routing-instance-name; } use-interface-description (device | logical); } active-server-group name; interface interface_name; } } } }
You can configure DHCP tracing using the traceoptions configuration as shown in the snippet below:
[edit] system { processes { dhcp-service { traceoptions { file jdhcpd size 20m; level all; flag all; } } } }
Verification
You can verify the DHCP statistics via the cRPD shell.
Use show dhcp statistics
to view DHCP service statistics.
root@controller-0> show dhcp statistics Packets dropped: Total 16 No routing instance 16
Use show dhcp relay statistics
to
display DHCP relay statistics.
root@controller-0> show dhcp relay statistics Packets dropped: Total 16 dhcp-service total 16 Messages received: BOOTREQUEST 0 DHCPDECLINE 0 DHCPDISCOVER 0 DHCPINFORM 0 DHCPRELEASE 0 DHCPREQUEST 0 DHCPLEASEACTIVE 0 DHCPLEASEUNASSIGNED 0 DHCPLEASEUNKNOWN 0 DHCPLEASEQUERYDONE 0 DHCPACTIVELEASEQUERY 0 Messages sent: BOOTREPLY 0 DHCPOFFER 0 DHCPACK 10 DHCPNAK 0 DHCPFORCERENEW 2 DHCPLEASEQUERY 2 DHCPBULKLEASEQUERY 0 DHCPLEASEACTIVE 0 DHCPLEASEUNASSIGNED 0 DHCPLEASEUNKNOWN 0 DHCPLEASEQUERYDONE 0 DHCPACTIVELEASEQUERY 7
Use show dhcpv6 relay statistics
to
view DHCPv6 relay statistics.
root@controller-0> show dhcpv6 relay statistics Dhcpv6 Packets dropped: Total 0 Messages received: DHCPV6_DECLINE 0 DHCPV6_SOLICIT 2 DHCPV6_INFORMATION_REQUEST 0 DHCPV6_RELEASE 0 DHCPV6_REQUEST 2 DHCPV6_CONFIRM 0 DHCPV6_RENEW 0 DHCPV6_REBIND 0 DHCPV6_RELAY_FORW 0 DHCPV6_LEASEQUERY_REPLY 0 DHCPV6_LEASEQUERY_DATA 0 DHCPV6_LEASEQUERY_DONE 0 DHCPV6_ACTIVELEASEQUERY 0 Messages sent: DHCPV6_ADVERTISE 0 DHCPV6_REPLY 0 DHCPV6_RECONFIGURE 0 DHCPV6_RELAY_REPLY 0 DHCPV6_LEASEQUERY 0 DHCPV6_LEASEQUERY_REPLY 2 DHCPV6_LEASEQUERY_DATA 0 DHCPV6_LEASEQUERY_DONE 0 DHCPV6_ACTIVELEASEQUERY 0
You can clear the DHCP statistics using the commands provided below:
clear dhcp statistics clear dhcp relay statistics clear dhcpv6 relay statistics