eNSP-DHCP全局配置和接口配置
文章目录
- eNSP-DHCP全局配置和接口配置
- 一、题目要求
- 二、题目分析
- 三、拓扑结构搭建
- 四、基本配置
- 五、测试验证
一、题目要求
要求 :
1 、GE0/0/0 口所在广播域使用全局配置模式
2 、 GE0/0/1 口所在广播域使用接口配置模式
3 、 租期时间为 1 小时
4 、 排除地址池中 IP 在 100 ~200 之间的所有 IP 地址
5 、 IP 网段自行规划 , 全网可达
二、题目分析
1、在接口0/0/0 中配置dhcp select global
2、在接口0/0/1 中配置dhcp select interface
3、lease day 0 hour 1 minute 0
4、excluded-ip-address 192.168.x.100 192.168.x.200
三、拓扑结构搭建
四、基本配置
1.PC配置:
PC1:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fea8:463b
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 0.0.0.0
Subnet mask.......................: 0.0.0.0
Gateway...........................: 0.0.0.0
Physical address..................: 54-89-98-A8-46-3B
DNS server........................:
PC2:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fecb:491c
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 0.0.0.0
Subnet mask.......................: 0.0.0.0
Gateway...........................: 0.0.0.0
Physical address..................: 54-89-98-CB-49-1C
DNS server........................:
PC3:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe54:173d
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 0.0.0.0
Subnet mask.......................: 0.0.0.0
Gateway...........................: 0.0.0.0
Physical address..................: 54-89-98-54-17-3D
DNS server........................:
PC4:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fea8:4f9c
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 0.0.0.0
Subnet mask.......................: 0.0.0.0
Gateway...........................: 0.0.0.0
Physical address..................: 54-89-98-A8-4F-9C
DNS server........................:
2.路由器配置:
全局配置接口0/0/0:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys DHCP Server
[DHCP Server]int g0/0/0
[DHCP Server-GigabitEthernet0/0/0]ip address 192.168.1.1 24
Jul 1 2023 18:17:49-08:00 DHCP Server %%01IFNET/4/LINK_STATE(l)[2]:The line pro
tocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[DHCP Server-ip-pool-pool]quit
[DHCP Server]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[DHCP Server]ip pool pool
[DHCP Server-ip-pool-pool]network 192.168.1.0 mask 24
[DHCP Server-ip-pool-pool]gateway-list 192.168.1.1
[DHCP Server-ip-pool-pool]dns-list 8.8.8.8
[DHCP Server-ip-pool-pool]lease day 0 hour 1 minute 0
[DHCP Server-ip-pool-pool]excluded-ip-address 192.168.1.100 192.168.1.200
[DHCP Server-ip-pool-pool]int g0/0/0
[DHCP Server-GigabitEthernet0/0/0]dhcp select global
[DHCP Server-GigabitEthernet0/0/0]quit
[DHCP Server]display interface brief
PHY: Physical
*down: administratively down
(l): loopback
(s): spoofing
(b): BFD down
^down: standby
(e): ETHOAM down
(d): Dampening Suppressed
InUti/OutUti: input utility/output utility
Interface PHY Protocol InUti OutUti inErrors outErrors
GigabitEthernet0/0/0 up up 0% 0% 0 0
GigabitEthernet0/0/1 up down 0% 0% 0 0
GigabitEthernet0/0/2 down down 0% 0% 0 0
NULL0 up up(s) 0% 0% 0 0
接口配置接口0/0/1:
[DHCP Server]dhcp enable
[DHCP Server]int g0/0/1
[DHCP Server-GigabitEthernet0/0/1]ip address 192.168.2.1 24
Jul 1 2023 18:25:40-08:00 DHCP Server %%01IFNET/4/LINK_STATE(l)[3]:The line pro
tocol IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[DHCP Server-GigabitEthernet0/0/1]dhcp select interface
[DHCP Server-GigabitEthernet0/0/1]dhcp server dns-list 8.8.8.8
[DHCP Server-GigabitEthernet0/0/1]dhcp server lease day 0 hour 1 minute 0
[DHCP Server-GigabitEthernet0/0/1]dhcp server excl
[DHCP Server-GigabitEthernet0/0/1]dhcp server excluded-ip-address 192.168.2.100
192.168.2.200
[DHCP Server-GigabitEthernet0/0/1]quit
[DHCP Server]
[DHCP Server]int g0/0/1
[DHCP Server-GigabitEthernet0/0/1]display interface brief
PHY: Physical
*down: administratively down
(l): loopback
(s): spoofing
(b): BFD down
^down: standby
(e): ETHOAM down
(d): Dampening Suppressed
InUti/OutUti: input utility/output utility
Interface PHY Protocol InUti OutUti inErrors outErrors
GigabitEthernet0/0/0 up up 0% 0% 0 0
GigabitEthernet0/0/1 up up 0% 0% 0 0
GigabitEthernet0/0/2 down down 0% 0% 0 0
NULL0 up up(s) 0% 0% 0 0
五、测试验证
PC1,2,3,4被分配了符合规则的ip地址,证明DHCP可用。
PC1:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fea8:463b
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.1
Physical address..................: 54-89-98-A8-46-3B
DNS server........................: 8.8.8.8
PC2:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fecb:491c
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.1
Physical address..................: 54-89-98-CB-49-1C
DNS server........................: 8.8.8.8
PC3:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe54:173d
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.2.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.2.1
Physical address..................: 54-89-98-54-17-3D
DNS server........................: 8.8.8.8
PC4:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fea8:4f9c
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.2.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.2.1
Physical address..................: 54-89-98-A8-4F-9C
DNS server........................: 8.8.8.8
使用PC1 ping PC3可达,证明全网可达。
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fea8:463b
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.1
Physical address..................: 54-89-98-A8-46-3B
DNS server........................: 8.8.8.8
PC>ping 192.168.2.254
Ping 192.168.2.254: 32 data bytes, Press Ctrl_C to break
From 192.168.2.254: bytes=32 seq=1 ttl=127 time=63 ms
From 192.168.2.254: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.2.254: bytes=32 seq=3 ttl=127 time=78 ms
From 192.168.2.254: bytes=32 seq=4 ttl=127 time=47 ms
From 192.168.2.254: bytes=32 seq=5 ttl=127 time=78 ms
--- 192.168.2.254 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 47/68/78 ms