< Home

dhcp server gateway-list

Function

The dhcp server gateway-list command sets the default gateway IP address that a DHCP server pre-allocates to DHCP clients.

The undo dhcp server gateway-list command deletes the configured default gateway IP address.

By default, the default gateway IP address that a DHCP server pre-allocates to DHCP clients is not configured.

Format

dhcp server gateway-list ip-address &<1-8>

undo dhcp server gateway-list { ip-address | all }

Parameters

Parameter Description Value

ip-address

Specifies an IP address. You can configure a maximum of eight gateway addresses, which are separated by spaces.

The value is in decimal dotted notation.

all

Indicates all IP addresses.

-

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

To load balance traffic and improve network reliability, you can configure multiple default gateway addresses.

Do not configure the default gateway address allocated to DHCP clients as a broadcast address.

If the VRRP virtual IP address is configured on the interface and no gateway address is pre-allocated to the DHCP client using the dhcp server gateway-list command, the DHCP server uses the first VRRP virtual IP address as the gateway address to be allocated to the client. If no VRRP virtual IP address is configured on the interface, the DHCP server uses the physical IP address of the interface as the gateway address to be allocated to the client.

If the dhcp server gateway-list command is not configured, the gateway address allocated by the DHCP server to the DHCP client may fail to be displayed in trace information during fault diagnosis. Therefore, you are advised to configure this command if the DHCP server function based on an interface address pool is used.

Prerequisites

  1. The DHCP function has been enabled using the dhcp enable command in the system view.
  2. IP addresses in the interface address pool have been configured using the ip address command.

  3. The DHCP server function has been enabled on the interface using the dhcp select interface command.

Example

# Enable a DHCP server on a VLANIF100 to pre-allocate default gateway address 10.1.1.1 to DHCP clients.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.1.1.1 24 
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server gateway-list 10.1.1.1
# Enable a DHCP server on GE0/0/1 to pre-allocate default gateway address 10.1.1.1 to DHCP clients.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] ip address 10.1.1.1 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server gateway-list 10.1.1.1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >