Configuring a DHCP relay address pool
This feature allows DHCP clients of the same type to obtain IP addresses and other configuration parameters from the DHCP servers specified in the matching relay address pool.
It applies to scenarios where the DHCP relay agent connects to clients of the same access type but classified into different types by their locations. In this case, the relay interface typically has no IP address configured. You can use the gateway-list command to specify the gateway address for clients matching the same relay address pool and bind the gateway address to the device's MAC address. Example network is the IPoE network.
Upon receiving a DHCP DISCOVER or REQUEST from a client that matches a relay address pool, the relay agent processes the packet as follows:
Fills the giaddr field of the packet with the specified gateway address.
Forwards the packet to all DHCP servers in the matching relay address pool.
The DHCP servers select an address pool according to the gateway address.
If PPPoE users are in the network, follow these restrictions and guidelines when you configure the relay address pool:
Enable the DHCP relay agent to record DHCP relay entries by using the dhcp relay client-information record command. When a PPPoE user goes offline, the DHCP relay agent can find a matching relay entry and send a DHCP-RELEASE message to the DHCP server. This mechanism ensures that the DHCP server is aware of the releasing of the IP address in a timely manner.
The remote-server command also configures the device as a DHCP relay agent. You do not need to enable the DHCP relay agent by using the dhcp select relay command.
To configure a DHCP relay address pool:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Create a DHCP relay address pool and enter its view. | dhcp server ip-pool pool-name | By default, no DHCP relay address pool exists. This command is the same for creating DHCP address pools on a DHCP server. However, the relay address pool names are not necessarily the same as the server address pool names. |
3. Specify gateway addresses for the clients matching the relay address pool. | gateway-list ip-address&<1-64> [ export-route ] | By default, no gateway address is specified. |
4. Specify DHCP servers for the relay address pool. | remote-server ip-address&<1-8> | By default, no DHCP server is specified for the relay address pool. You can specify a maximum of eight DHCP servers for one relay address pool for high availability. The relay agent forwards DHCP DISCOVER and REQUEST packets to all DHCP servers in the relay address pool. |