eNSP(华为) 配置基于全局地址池的DHCP

时间:2024-03-09 09:32:23

拓扑图:

 

 

          全局地址池的DHCP

AR2的配置 :

[Huawei]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.2.254 24
[R1-GigabitEthernet0/0/1]q

[R1]dhcp enable
[R1]ip pool huawei1
[R1-ip-pool-huawei1]network 192.168.1.0    //指定地址池范围


[R1-ip-pool-huawei1]lease day 2
[R1-ip-pool-huawei1]gateway-list 192.168.1.254
[R1-ip-pool-huawei1]excluded-ip-address 192.168.1.1 192.168.1.10
[R1-ip-pool-huawei1]dns-list 6.6.6.6
[R1-ip-pool-huawei1]q
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]dhcp select global   //开启接口的DHCP功能
[R1-GigabitEthernet0/0/0]q

[R1]ip pool huawei2
[R1-ip-pool-huawei2]network 192.168.2.0
[R1-ip-pool-huawei2]gateway-list 192.168.2.254
[R1-ip-pool-huawei2]dns-list 8.8.8.8
[R1-ip-pool-huawei2]excluded-ip-address 192.168.2.1 192.168.2.10
[R1-ip-pool-huawei2]q
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]dhcp select global
[R1-GigabitEthernet0/0/1]q

测试如下:

1.

 

 2.

 

 3.