How do I configure DHCP Relay on cnMatrix Switches in CLI

Summary: This article describes how to configure the DHCP Relay feature for cnMatrix Switches. DHCP Relay agent allows the DHCP client and DHCP server in different subnets to communicate with
each other so that the DHCP client can obtain its IP address and configuration.

Note: Even though the feature can be enabled on a VLAN or port, it will relay packets from all

In order for the DHCP Server to know what subnet to provide an IP address for, the Switches will need a Layer 3 VLAN Interface for every VLAN as well as a Layer 2 VLAN. This will then be used as the source address that the DHCP server receives.


  1. Login to the cnMatrix Switch via SSH or Console

  2. Create the Layer 3 VLAN Interface if you haven’t already, then configure the DHCP Relay commands. In the below example, I will use VLAN 10.

    config terminal
    interface vlan 10
    ip address dhcp or ip address <IP address> <Subnet>
    no shutdown
    service dhcp-relay
    ip dhcp server <your DHCP server address>
    copy running-config startup-config