dhcp relay gateway-switch enable
Function
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 Guidelines
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
- Global DHCP has been enabled by using the dhcp enable command in the system view.
- DHCP relay has been enabled on an interface by using the dhcp select relay command.
Precautions
- The gateway address switches from the primary IP address to a secondary IP address only when a user fails to obtain an IP address by using the primary IP address for at least three times and the interval between the last failure and first failure exceeds 24 seconds.
- Before running this command on an interface, ensure that the interface has a primary IP address and at least one secondary IP address.
- If a primary IP address and multiple secondary IP addresses are configured on an interface, the system tries the secondary IP addresses one by one until users successfully obtain IP addresses.
Example
<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