DHCP Relay Operational Commands

Verify DHCP Relay Configuration

A good starting point for any troubleshooting is to get an overview about the configuration. First check the DHCP server configuration and optionally check the reachability using additional commands like ping.

supervisor@rtbrick>LEAF01: cfg> show config access dhcp-server
{
    "rtbrick-config:dhcp-server": [
      {
        "server-name": "server1",
        "address": "198.51.100.15",
        "source-address": "198.51.100.101",
        "routing-instance": "default"
      }
    ]
  }

In the next step it should be verified that the DHCP relay function is enabled for the desired logical interfaces. Those interfaces must be configured with a valid local or borrowed (unnumbered) IPv4 address.

supervisor@rtbrick>LEAF01: cfg> show config access dhcp-relay
{
    "rtbrick-config:dhcp-relay": [
      {
        "interface": "ifl-0/0/1/1",
        "dhcp-server": [
          "server1",
          "server2"
          ]
      }
    ]
  }

Verify DHCP Relay Packet Processing

All DHCP packets processed by RBFS will be handled by the IPoE daemon (rtbrick-ipoed.1) which separates between DHCP relay and subscriber packets. The command show dhcp statistics gives some statistics about the DHCP packets send and received by the IPoE daemon.

Example: DHCP statistics

supervisor@rtbrick: op> show dhcp statistics
Global DHCPv4 statistics
Total packets received      : 1
Decode error                : 0

IP DHCPv4 relay statistics
Relay packets received      : 1
Relay packets sent          : 1
Relay encode error          : 0
Relay send error            : 0

IPoE DHCPv4 subscriber statistics
IPoE packets received       : 0
IPoE packets sent           : 0
IPoE encode error           : 0
IPoE send error             : 0

Received malformed packets will be counted here as part of the shared DHCP packet infrastructure.

Those statistics can be reset with the command clear dhcp statistics.

In the next step, the command show dhcp relay statistics provides more detailed statistics for those packets handled by the DHCP relay function.

Example: DHCP relay statistics

supervisor@rtbrick: op> show dhcp relay statistics
Packet           Received         Sent
DHCP DISCOVER  : 2                2
DHCP OFFER     : 1                1
DHCP REQUEST   : 1                1
DHCP DECLINE   : 0                0
DHCP ACK       : 1                1
DHCP NAK       : 0                0
DHCP RELEASE   : 0                0
DHCP INFORM    : 0                0

Errors:

Invalid client packets received : 0
Invalid server packets received : 0
I/O errors                      : 0
Configuration errors            : 0
Dropped min elapsed             : 0
supervisor@rtbrick: op> show dhcp relay statistics
Packet           Received         Sent
DHCP DISCOVER  : 2                2
DHCP OFFER     : 1                1
DHCP REQUEST   : 1                1
DHCP DECLINE   : 0                0
DHCP ACK       : 1                1
DHCP NAK       : 0                0
DHCP RELEASE   : 0                0
DHCP INFORM    : 0                0

Errors:

Invalid client packets received : 0
Invalid server packets received : 0
I/O errors                      : 0
Configuration errors            : 0
Dropped min elapsed             : 0

A DHCP packet is consider as invalid if correctly formed but some invalid or unexpected values like a DHCP hop count greater than 16, messages from server without server identifier option, non-matching transaction (XID) and many more.

Those statistics can be reset with the command clear dhcp relay statistics.

Verify DHCP Relay Bindings

The DHCP relay function tracks all active DHCP communications as so called bindings. The command show dhcp relay binding allows to verify those bindings with extensive filters to better navigate in scaled environments with thousands of bindings.

Syntax:

show dhcp relay binding <option>

Option Description

-

Without any option, the commands displays all DHCP relay binding details.

detail

Detailed binding information.

filter

Filter DHCP relay binding.

interface

Binding information for the specified interface.

DHCP Relay Binding

Syntax:

show dhcp relay binding filter <option>

Option Description

address

Filters DHCP relay bindings based on the specified client IP address.

count

Displays only the count of bindings that match the applied filter criteria.

detail

Displays detailed information for DHCP relay bindings that match the filter.

interface

Filters bindings associated with a specific interface.

interface-regex

Filters bindings for interfaces that match the specified regular expression.

mac

Filters bindings based on the specified client hardware (MAC) address.

mac-regex

Filters bindings for MAC addresses that match the specified regular expression.

server

Filters bindings associated with a specific DHCP server identifier.

Example: DHCP relay binding details

supervisor@rtbrick: op> show dhcp relay binding detail
Interface                  : ifl-0/1/23/100
Hardware Address           : 02:00:00:00:00:01
Client IP Address          : 203.0.113.200
Routing Instance           : default
Server Identifier          : 192.0.2.2
Gateway IP Address         : 203.0.113.129
Lease Time                 : 35.0 sec
Lease Start                : Fri Jun 05 04:45:50 GMT +0000 2026
Lease Expires              : 29.0 sec
Last Packet Received       : Fri Jun 05 04:45:50 GMT +0000 2026
Last Received Packet Type  : ACK
Last Packet Sent           : Fri Jun 05 04:45:50 GMT +0000 2026
Last Sent Packet Type      : ACK

The most extensive output is provided by selecting a particular binding using the interface and client MAC address as key.

Example: DHCP relay binding interface information

supervisor@rtbrick: op> show dhcp relay binding interface ifl-0/1/23/100 mac 02:00:00:00:00:01
Interface                  : ifl-0/1/23/100
Hardware Address           : 02:00:00:00:00:01
Client IP Address          : 203.0.113.200
Routing Instance           : default
Server Identifier          : 192.0.2.2
Gateway IP Address         : 203.0.113.129
Lease Time                 : 35.0 sec
Lease Start                : Fri Jun 05 04:45:50 GMT +0000 2026
Lease Expires              : 30.0 sec
Last Packet Received       : Fri Jun 05 04:45:50 GMT +0000 2026
Last Received Packet Type  : ACK
Last Packet Sent           : Fri Jun 05 04:45:50 GMT +0000 2026
Last Sent Packet Type      : ACK

Statistics:

Packet           Received         Sent
DHCP DISCOVER  : 1                1
DHCP OFFER     : 1                1
DHCP REQUEST   : 1                1
DHCP DECLINE   : 0                0
DHCP ACK       : 1                1
DHCP NAK       : 0                0
DHCP RELEASE   : 0                0
DHCP INFORM    : 0                0

Errors:

Invalid client packets received : 0
Invalid server packets received : 0
I/O errors                      : 0
Configuration errors            : 0
Dropped min elapsed             : 0

This output returns additional statistics per DHCP relay binding.

Clear Commands

The command clear dhcp relay binding removes either all bindings, all bindings of a corresponding interface or only one particular binding.

Syntax:

clear dhcp relay binding

Option Description

all

Clears all DHCP relay bindings from the system.

interface

Clears DHCP relay bindings associated with the specified interface.

Example:

clear dhcp relay binding all
clear dhcp relay binding interface ifp-0/0/1/3
clear dhcp relay binding interface ifp-0/0/1/3 mac 02:00:00:00:00:01