Using the dhcp relay gateway-switch enable command, you can enable DHCP relay gateway switching.
Using the undo dhcp relay gateway-switch enable command, you can disable DHCP relay gateway switching.
By default, DHCP relay gateway switching is disabled.
Usage Scenario
The dhcp relay gateway-switch enable command is used on DHCP relay agents. This command allows a DHCP relay agent to use a secondary IP address as the gateway address to apply for IP addresses for users when it fails to use the primary IP address to apply for IP addresses.
Prerequisites
Precautions
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface vlanif 10 [HUAWEI-Vlanif10] ip address 192.168.30.1 255.255.255.0 [HUAWEI-Vlanif10] ip address 192.168.31.1 255.255.255.0 sub [HUAWEI-Vlanif10] dhcp select relay [HUAWEI-Vlanif10] dhcp relay server-ip 192.168.20.1 [HUAWEI-Vlanif10] dhcp relay gateway-switch enable
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] undo portswitch [HUAWEI-GigabitEthernet0/0/1] ip address 192.168.30.1 255.255.255.0 [HUAWEI-GigabitEthernet0/0/1] ip address 192.168.31.1 255.255.255.0 sub [HUAWEI-GigabitEthernet0/0/1] dhcp select relay [HUAWEI-GigabitEthernet0/0/1] dhcp relay server-ip 192.168.20.1 [HUAWEI-GigabitEthernet0/0/1] dhcp relay gateway-switch enable