DHCP relay


The DHCP relay listens for DHCP queries and responses. When a query is received from a client, it is forwarded to the specified DHCP server(s). When a reply is received from a server, it is forwarded to the client that made the initial request.

The DHCP relay needs at least the IP address of a reachable DHCP server.

You can configure the DHCP relay parameters in the dhcp relay context.

vrouter running config# vrf VRFNAME dhcp relay
VRF name on which the DHCP relay must run.

See also

The DHCP relay command reference for details.

DHCP relay configuration

  • To relay the DHCP clients’ requests to DHCP servers, the DHCP relay must know the IPv4 address of a DHCP server.

    vrouter running relay# dhcp-server A.B.C.D

    IPv4 address of a DHCP server connected to the DHCP relay.

  • By default the DHCP relay will listen on all broadcast interfaces. But it’s also possible to specify one or more interfaces on which listen:

    vrouter running dhcp-server A.B.C.D# interface IFNAME

    Name of an interface to which a DHCP server is connected.

  • The dhcp-server configuration can be disabled:

    vrouter running dhcp-server A.B.C.D# enabled false

DHCP configuration options

DHCP relay options can be specified in the root DHCP relay context or overwritten per dhcp-server.

Handle option

  • Specify the handling policy of DHCPv4 packets that already contain relay agent options:

    vrouter running dhcp-server A.B.C.D# handle-option append|replace|forward|discard

    Append its own set of relay options to the packet.


    Replace the existing agent option field.


    Forward the packet unchanged.


    Discard the packet.

Drop unmatched packets

  • Packets coming from upstream servers who contains relay agent information options that indicate they were generated in response to a query that came via a different relay agent can be dropped:

    vrouter running dhcp-server A.B.C.D# drop-unmatched true

Maximum hop

  • Specify the maximum hop count before discard a packet:

    vrouter running dhcp-server A.B.C.D# hop-count <0-255>

Maximum packet size

  • Specify the maximum packet size to send to a DHCPv4 server. If a DHCP packet size surpasses this value it will be forwarded without appending relay agent information:

    vrouter running dhcp-server A.B.C.D# max-size <64-1400>

Configuration example

vrouter> edit running
vrouter running config# vrf main
vrouter running vrf main# dhcp
vrouter running dhcp# relay
vrouter running relay# hop-count 5
vrouter running relay# dhcp-server
vrouter running dhcp-server interface eth0
vrouter running dhcp-server interface eth1
vrouter running dhcp-server drop-unmatched true
vrouter running dhcp-server ..
vrouter running relay# ..
vrouter running dhcp#

The same configuration can be made using this NETCONF XML configuration:

vrouter> show config xml absolute vrf main dhcp relay
<config xmlns="urn:6wind:vrouter">
    <dhcp xmlns="urn:6wind:vrouter/dhcp">