NVIDIA DOCA™ HBN can relay DHCP requests and replies between clients and servers on different subnets. You can configure DHCPv4 and DHCPv6 relay services by using NVIDIA® user experience (NVUE) or persistent Supervisor configuration files on the NVIDIA® BlueField® system.
Before You Begin
-
Determine whether the deployment will be managed through NVUE or flat files. Do not configure the same relay instance through both methods.
-
Identify the upstream and downstream interfaces, the DHCP server address, and the VRF in which the relay will run.
-
Replace the interface names, server addresses, VRF names, and identifiers in the examples with values for the deployment.
HBN runs in a non-systemd container. Flat-file configuration therefore uses Supervisor rather than a systemd service.
Configuration Methods
Flat-File Configuration With Supervisor
The HBN initialization script installs the default configuration files in /var/lib/hbn/etc/supervisor/conf.d/ on the BlueField system. This directory is mounted in the HBN container at /etc/supervisor/conf.d so that the configuration persists.
DHCP relay is disabled by default. The default configuration supports one DHCPv4 relay instance and one DHCPv6 relay instance in the default VRF.
NVUE Configuration
Use the NVUE CLI or REST API to configure and maintain DHCPv4 and DHCPv6 relay services. NVUE generates the required service configuration and manages the relay process.
DHCPv4 Relay
NVUE Example
The following example listens for DHCP messages on p0_if, p1_if, and downstream interface vlan482. It forwards requests to DHCP server 10.89.0.1 and uses lo as the gateway interface.
nv set service dhcp-relay default gateway-interface lo
nv set service dhcp-relay default interface p0_if
nv set service dhcp-relay default interface p1_if
nv set service dhcp-relay default interface vlan482 downstream
nv set service dhcp-relay default server 10.89.0.1
After applying the configuration, the relay instance forwards DHCPv4 requests received on the configured downstream interface to the configured server.
Flat-File Example
[program: isc-dhcp-relay-default]
command = /usr/sbin/dhcrelay --nl -d -i p0_if -i p1_if -id vlan482 -U lo 10.89.0.1
autostart = true
autorestart = unexpected
startsecs = 3
startretries = 3
exitcodes = 0
stopsignal = TERM
stopwaitsecs = 3
DHCPv4 Relay Options
|
Option |
Description |
|---|---|
|
|
Listens for requests and replies on the specified interface. |
|
|
Specifies an upstream interface. |
|
|
Specifies a downstream interface. |
|
|
Specifies the gateway IP address or interface. In a Supervisor configuration file, use |
|
|
Enables debug logging in |
|
|
Adds an agent option field with default |
|
|
Sets a custom remote ID of up to 255 characters. This option requires |
|
|
Uses the underlying physical ingress interface as the |
DHCPv4 Relay Option 82
NVUE Example
Enable Option 82 insertion with the default values:
nv set service dhcp-relay default agent enable on
Configure a custom remote-id, such as host10:
nv set service dhcp-relay default agent remote-id host10
Use the physical ingress interface as the circuit-id:
nv set service dhcp-relay default agent use-pif-circuit-id enable on
Flat-File Example
[program: isc-dhcp-relay-default]
command = /usr/sbin/dhcrelay --nl -d -i p0_if -i p1_if -id vlan482 -U lo -a --use-pif-circuit-id -r host10 10.89.0.1
autostart = true
autorestart = unexpected
startsecs = 3
startretries = 3
exitcodes = 0
stopsignal = TERM
stopwaitsecs = 3
DHCPv6 Relay
NVUE Example
The following example listens for DHCPv6 requests on downstream interface vlan482 and forwards the relayed requests through upstream interfaces p0_if and p1_if.
nv set service dhcp-relay6 default interface downstream vlan482
nv set service dhcp-relay6 default interface upstream p0_if
nv set service dhcp-relay6 default interface upstream p1_if
Flat-File Example
[program: isc-dhcp-relay6-default]
command = /usr/sbin/dhcrelay --nl -6 -d -l vlan482 -u p0_if -u p1_if
autostart = true
autorestart = unexpected
startsecs = 3
startretries = 3
exitcodes = 0
stopsignal = TERM
stopwaitsecs = 3
DHCPv6 Relay Options
|
Option |
Description |
|---|---|
|
|
Specifies a downstream interface. In a Supervisor configuration file, use |
|
|
Specifies an upstream interface. In a Supervisor configuration file, use |
|
|
Enables IPv6 relay operation. |
|
|
Enables debug logging in |
VRF Considerations
You can run a DHCP relay instance in a VRF to handle requests in that routing domain. Each VRF can contain no more than one DHCPv4 relay instance and one DHCPv6 relay instance.
-
DHCPv4 in the default VRF:
/usr/sbin/dhcrelay --nl -i <interface> -U [address]%%<interface> <server_ip> -
DHCPv4 in a non-default VRF:
/usr/sbin/ip vrf exec <vrf> /usr/sbin/dhcrelay --nl -i <interface> -U [address]%%<interface> <server_ip> -
DHCPv6 in the default VRF:
/usr/sbin/dhcrelay --nl -6 -l <interface> -u <interface> -
DHCPv6 in a non-default VRF:
/usr/sbin/ip vrf exec <vrf> /usr/sbin/dhcrelay --nl -6 -l <interface> -u <interface>
Last updated: