现有一网络拓扑图如上
要求:①AR1 GE000口用接口DHCP分配IP ②AR1001口用全局DHCP分配IP ③各PC间互通
思路:
①想给PC1、2分配IP需要进入充当DHCP服务器的AR1的000端口配置IP,启用DHCP协议,配置接口地址池并调用。无需配置IP和网关。同时PC1、2基础配置勾选DHCP并应用。
②想给PC34分配IP需要进入AR1的001端口配置IP,启用DHCP协议,配置全局地址池并调用。同时PC3、4基础配置勾选DHCP并应用。
③进入PC1pingPC3和PC4
配置:
①:
AR1 000端口:
<Huawei>system-view *切换视角*
[Huawei]dhcp enable *启用DHCP协议*
[Huawei]interface g0/0/0 *进入000端口*
[Huawei-GigabitEthernet0/0/0]ip address 10.1.1.1 24 *配置地址为10.1.1.1掩码为24的IP*
[Huawei-GigabitEthernet0/0/0]dhcp select interface *激活接口地址池*
[Huawei-GigabitEthernet0/0/0]dhcp server dns-list 8.8.8.8 *配置接口地址池DNS*.1
进入PC1,ipconfig:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe42:5c5e
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 10.1.1.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 10.1.1.1
Physical address..................: 54-89-98-42-5C-5E
DNS server........................: 8.8.8.8
进入PC2,ipconfig:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fefa:75f8
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 10.1.1.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 10.1.1.1
Physical address..................: 54-89-98-FA-75-F8
DNS server........................: 8.8.8.8
②:
AR1 001端口:
<Huawei>system-view *切换视角*
[Huawei]dhcp enable *启用DHCP协议*
[Huawei]interface g0/0/1 *进入001端口*
[Huawei-GigabitEthernet0/0/1]ip address 10.1.2.1 24 *配置地址为10.1.2.1掩码为24的IP*
[Huawei-GigabitEthernet0/0/1]ip pool NAME *创建名为NAME的地址池*
[Huawei-ip-pool-NAME]network 10.1.2.0 mask 24 *配置可分配的IP网段*
[Huawei-ip-pool-NAME]gateway-list 10.1.2.1 *配置网关*
[Huawei-ip-pool-NAME]dns-list 8.8.8.8 114.114.114.114 *配置DNS*
[Huawei-ip-pool-NAME]q *退出池塘*
[Huawei]interface g0/0/1 *再次进入001端口*
[Huawei-GigabitEthernet0/0/1]dhcp select global *激活全局配置*
进入PC3,ipconfig:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe17:24ce
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 10.1.2.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 10.1.2.1
Physical address..................: 54-89-98-17-24-CE
DNS server........................: 8.8.8.8
114.114.114.114
进入PC4,ipconfig:
Link local IPv6 address...........: fe80::5689:98ff:feb2:4cf5
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 10.1.2.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 10.1.2.1
Physical address..................: 54-89-98-B2-4C-F5
DNS server........................: 8.8.8.8
114.114.114.114
③
PC1PINGPC3:
PC>ping 10.1.2.254
Ping 10.1.2.254: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 10.1.2.254: bytes=32 seq=2 ttl=127 time=78 ms
From 10.1.2.254: bytes=32 seq=3 ttl=127 time=78 ms
From 10.1.2.254: bytes=32 seq=4 ttl=127 time=63 ms
From 10.1.2.254: bytes=32 seq=5 ttl=127 time=94 ms
--- 10.1.2.254 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/78/94 ms
PC1PINGPC4:
PC>ping 10.1.2.253
Ping 10.1.2.253: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 10.1.2.253: bytes=32 seq=2 ttl=127 time=62 ms
From 10.1.2.253: bytes=32 seq=3 ttl=127 time=47 ms
From 10.1.2.253: bytes=32 seq=4 ttl=127 time=78 ms
From 10.1.2.253: bytes=32 seq=5 ttl=127 time=78 ms
--- 10.1.2.253 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/66/78 ms