华为DHCP命令
1、配置基于接口地址池的DHCP
[Huawei]dhcp enable [Huawei]interface GigabitEthernet0/0/0 [Huawei-GigabitEthernet0/0/0]dhcp select interface [Huawei-GigabitEthernet0/0/0]dhcp server dns-list 10.1.1.2 [Huawei-GigabitEthernet0/0/0]dhcp server excluded-ip-address 10.1.1.2 [Huawei-GigabitEthernet0/0/0]dhcp server lease day 3
验证:
2、配置基于全局地址池的DHCP
[Huawei]dhcp enable [Huawei]ip pool pool2 Info: It's successful to create an IP address pool. [Huawei-ip-pool-pool2]network 1.1.1.0 mask 24 [Huawei-ip-pool-pool2]gateway-list 1.1.1.1 [Huawei-ip-pool-pool2]lease day 10 [Huawei-ip-pool-pool2]quit [Huawei]interface GigabitEthernet0/0/1 [Huawei-GigabitEthernet0/0/1]dhcp select global
验证:
3、DHCP中继
配置DHCP relay [RELAY] dhcp server group dhcpgroup1 [RELAY-dhcp-server-group-dhcpgroup1] dhcp-server 1.0.0.1 [RELAY-dhcp-server-group-dhcpgroup1] quit [RELAY] dhcp enable [RELAY] interface GigabitEthernet 0/0/1 [RELAY -GigabitEthernet0/0/1]dhcp select relay [RouterA-Vlanif100] dhcp relay server-select dhcpgroup1 [RouterA-Vlanif100] quit