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.
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 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.
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.
system-view
dhcp enable
By default, the DHCP service is enabled.
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.
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.
dhcp select relay
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.
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.
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.
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.
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.
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.