< Home

Configuring the Device as a DHCP Relay

A DHCP client communicates with and obtains an IP address from a DHCP server on another network segment through a DHCP relay agent. DHCP relay allows DHCP clients on different network segments to share a DHCP server, which reduces costs and manage information uniformly.

Prerequisites

  • A DHCP server has been configured based on a global address pool.

    No interface address pool can be configured for the DHCP server interface that connects to the DHCP relay.

  • The DHCP server and the DHCP relay interface are routable to each other.
  • The DHCP relay interface and the DHCP client reside on the same network segment.

    The IP address of the DHCP relay interface is on the same network segment as the IP address of the client that is assigned by the DHCP server.

  • The default gateway address of the DHCP client must be the IP address of the DHCP relay interface.

Context

During certain phases in DHCP configuration, the DHCP client sends broadcast packets; therefore, the DHCP relay interface must support the broadcast mode.

A DHCP relay interface supports a maximum of 20 DHCP server addresses.

Perform the following steps to configure one DHCP relay interface.

A DHCP message sent from a client to a server can be relayed for a maximum of four times. If more than four times, the packet will be discarded. If more than one DHCP relay agent exists on the network, the DHCP relay function must be enabled on each DHCP relay agent, and the client, relay agents, and DHCP server are routable to each other. The last DHCP relay agent specifies the IP address of the DHCP server as the source IP address. The other DHCP relay agents specify the IP address of the next DHCP relay as the source IP address.

Procedure

  1. Access the system view.

    system-view

  2. Enable DHCP.

    dhcp enable

    By default, the DHCP service is enabled.

  3. Access the DHCP relay interface view.

    interface interface-type interface-number [ .sub-interface-number ]

    The interface can be a GE interface or its subinterface, a Vlanif interface, or an Eth-trunk interface.

  4. Specify the DHCP server IP address for the DHCP relay interface.

    ip relay address ip-address

    When more than one DHCP relay agents exist on a network, the last DHCP relay agent specifies the IP address of the DHCP server. The other DHCP relay agents specify the IP address of the next DHCP relay agent.

  5. Apply the DHCP relay interface configurations to the current interface.

    dhcp select relay

Follow-up Procedure

  1. Configure a DHCP client (using a Windows XP-based PC as an example).

    Set the network connection properties.

    Set Internet Protocol (TCP/IP) Properties to Obtain an IP address automatically and Obtain DNS server address automatically.

  2. On each DHCP client, run the ipconfig /all command to view the configuration of the DHCP client. Check whether the DHCP client has obtained the key configuration, including an IP address, a default gateway, and a DNS server.

    • If all key information is displayed, no action is required.
    • If some PCs fail to obtain the information, such as IP addresses, troubleshoot the PC settings and network connections. Then, go to 2.
    • If some PCs obtain IP addresses but fail to obtain other network parameters, restart the PC NIC to disable and enable the network connection. Or, run the ipconfig /release command and the ipconfig /renew command in sequence to apply for new IP addresses and network parameters. Then, go to 2.
    • If all PCs fail to obtain the information, such as IP addresses, go to 3.
  3. On the DHCP relay agent, run the display dhcp relay statistics command to view DHCP relay statistics, including the numbers of false packets and different types of DHCP messages.

    If the number of packets sent and received between the DHCP relay, server, and client is 0, the communication is down.

    • If the number is 0, verify that the dhcp select relay command has been executed on the relay interface. Run the display dhcp relay configuration command to check whether the specified DHCP server address is correct. If the number remains 0, go to 4, 5, and 6.
    • If the number is not 0 but DHCP messages received from servers is 0, go to 5 and 6.
    • If the number is not 0 but DHCP messages received from clients is 0, go to 4 and 6.
  4. On the DHCP client, run the ping command to check whether the DHCP client and relay agent are routable to each other. If they are not routable, troubleshoot the network connection problem.

  5. On the DHCP relay, run the ping command to check whether the DHCP relay interface and the DHCP server are routable to each other. If they are not routable, troubleshoot the network connection and routing problems.

  6. Check whether the security policy rules are correct. Add the interfaces to security zones and enable security policy between the security zone where the DHCP relay interface resides and the Local zone, to allow packets through.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >