Specifying the source IP address for relayed DHCP requests

About specifying the source IP address for relayed DHCP requests

This task is required if multiple relay interfaces share the same IP address or if a relay interface does not have routes to DHCP servers. You can specify an IP address or the IP address of another interface, typically the loopback interface, on the DHCP relay agent as the source IP address for DHCP requests. The relay interface inserts the source IP address in the source IP address field as well as the giaddr field in DHCP requests.

If multiple relay interfaces share the same IP address, you must also configure the relay interface to support Option 82. Upon receiving a DHCP request, the relay interface inserts the subnet information in sub-option 5 in Option 82. The DHCP server assigns an IP address according to sub-option 5. The DHCP relay agent looks up the output interface in the MAC address table to forward the DHCP reply.

Procedure

  1. Enter system view.

    system-view

  2. Enter interface view.

    interface interface-type interface-number

  3. Specify the source IP address for DHCP requests.

    dhcp relay source-address { ip-address | interface interface-type interface-number }

    By default, the DHCP relay agent uses the primary IP address of the interface that connects to the DHCP server as the source IP address for relayed DHCP requests. If this interface does not have an IP address, the DHCP relay agent uses an IP address that shares the same subnet with the DHCP server.

    You can specify only one source IP address for DHCP requests on an interface.