The dhcp relay server-ip command configures a DHCP server address on an interface enabled with DHCP relay.
The undo dhcp relay server-ip command deletes the configured DHCP server addresses on an interface enabled with DHCP relay.
By default, no DHCP server address on an interface enabled with DHCP relay is configured.
Parameter |
Description |
Value |
---|---|---|
ip-address |
Specifies the IP address of a DHCP server. |
The value is in dotted decimal notation. |
all |
Deletes all the DHCP server addresses configured on an interface. |
- |
Usage Scenario
This command applies to DHCP relay agents. When a DHCP client needs to send a DHCP Discover message to a DHCP server on a different network segment through a DHCP relay agent, you must configure the DHCP server address on the DHCP relay agent.
Prerequisites
DHCP relay has been enabled on the interface using the dhcp select relay command.
Precautions
If you run the dhcp relay server-ip command for multiple times, multiple DHCP server addresses are configured.
Each interface that is enabled with DHCP relay can be configured with a maximum of 20 DHCP server addresses.
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] vlan 10 [HUAWEI-vlan10] quit [HUAWEI] interface vlanif 10 [HUAWEI-Vlanif10] dhcp select relay [HUAWEI-Vlanif10] dhcp relay server-ip 10.1.1.2 [HUAWEI-Vlanif10] dhcp relay server-ip 10.1.1.3
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] undo portswitch [HUAWEI-GigabitEthernet0/0/1] dhcp select relay [HUAWEI-GigabitEthernet0/0/1] dhcp relay server-ip 10.1.1.2 [HUAWEI-GigabitEthernet0/0/1] dhcp relay server-ip 10.1.1.3