If a gateway address for clients is configured on the DHCP server, clients obtain the gateway address from the DHCP server and automatically generate a default route to the gateway address. Then the clients can access the hosts on other network segments. If the DHCP server is configured with Option 121 to allocate classless static routes to clients, the clients generate routes based on only the static routes and does not generate a default route to the gateway address. To load balance traffic and improve network reliability, configure multiple gateway addresses. A maximum of eight gateway addresses can be configured for each address pool.
In the scenario where both VRRP and DHCP are configured, if a VRRP group functions as the DHCP server, configure the gateway address of clients as the virtual IP address of the VRRP group.
If the DHCP server and clients are on the same network segment and the DHCP server functions as the gateway of clients, you do not need to configure a gateway address for clients.
Enter the system view.
system-view
Create a DHCP Option template and enter the DHCP Option template view.
dhcp option template template-name
By default, no DHCP Option template is created.
To allocate network parameters except IP addresses to static clients, configure a DHCP Option template. Network parameters configured in the DHCP Option template view take effect only for static clients. For static clients, if a network parameter is configured in both the DHCP Option template view and global address pool view, only the configuration in the DHCP Option template view takes effect.
To allocate only IP addresses to static clients (for details, see (Optional) Configuring Fixed IP Addresses in an Address Pool), you do not need to configure a DHCP Option template.
Specify a gateway address that the DHCP server sends to clients.
gateway-list ip-address &<1-8>
By default, no egress gateway address is configured.
If you need to configure other items in the DHCP Option template view, complete them first before performing the following steps.
quit
ip pool ip-pool-name
static-bind ip-address ip-address mac-address mac-address option-template template-name