一、拓扑图
二、需求
1.通过DHCP服务,给PC1和PC2分配IP地址、网关、掩码、DNS服务器IP地址
2.Client-1手工配置IP地址,为192.168.1.1,可以通过该设备使用域名成功访问HTTP服务器
3.telnet客户端可以远程登录telent服务器进行设备管理,并成功修改telnet服务器的名称为123,telnet客户端设备登录的账号和密码为:admin/admin
4.要求DHCP服务器需要排除被手工配置的IP地址;并修改租期时间为1小时;
5.最终实现每台终端都可以相互通讯(ping成功)
6.整个拓扑图便用 192.168.1.0/24网段进行分配
三、需求分析
1.AR1作为DHCP服务器,首先需要完成端口ip地址配置与ip地址子网划分。
子网划分将192.168.1.0/24 分配为192.168.1.0/25 和192.168.1.128/25 两个IP地址池塘,
192.168.1.0/25 IP池塘命名为leiyuyang;
192.168.1.128/25 IP池塘命名为leiyuyang2;
为0/0/0端口ip配置为192.168.1.100 25;
为0/0/1端口ip配置为192.168.1.200 25。
2.对两个ip池塘绑定DNS服务器。
3.对telnet客户端与服务器 进行ip地址配置,telent服务开启,以及远程登录,设置登录账号与密码。
4.配置DHCP服务器,排除被手工配置的IP地址,并修改租期时间为1小时。
5.对Client-1手工配置IP地址为192.168.1.1,并做到能通过该设备使用域名成功访问HTTP服务器。
6.将pc1与pc2的 ipv4 地址获取方式改为DHCP模式,使DHCP服务器为其自动分配IP地址、网关、掩码、DNS服务器IP地址。
四、配置过程
1.DHCP配置:
IP池塘分配、端口匹配、DNS服务器绑定:
leiyuyang池塘:
[DHCP Server]dhcp enable
[DHCP Server]ip pool leiyuyang
Info: It's successful to create an IP address pool.
[DHCP Server-ip-pool-leiyuyang]net
[DHCP Server-ip-pool-leiyuyang]netw
[DHCP Server-ip-pool-leiyuyang]network 192.168.1.0 mask 25
[DHCP Server-ip-pool-leiyuyang]gate
[DHCP Server-ip-pool-leiyuyang]gateway-list 192.168.1.100
[DHCP Server-ip-pool-leiyuyang]dns-list 192.168.1.150
[DHCP Server-ip-pool-leiyuyang]quit
[DHCP Server]interface GigabitEthernet 0/0/0
[DHCP Server-GigabitEthernet0/0/0]dhcp se
[DHCP Server-GigabitEthernet0/0/0]dhcp select global
leiyuyang2池塘:
[DHCP Server]ip pool leiyuyang2
Info: It's successful to create an IP address pool.
[DHCP Server-ip-pool-leiyuyang2]network 192.168.1.128 mask 25
[DHCP Server-ip-pool-leiyuyang2]gat
[DHCP Server-ip-pool-leiyuyang2]gateway-list 192.168.1.200
[DHCP Server]interface GigabitEthernet 0/0/1
[DHCP Server-GigabitEthernet0/0/1]dhcp se
[DHCP Server-GigabitEthernet0/0/1]dhcp select gl
[DHCP Server-GigabitEthernet0/0/1]dhcp select global
端口ip:
[DHCP Server]interface GigabitEthernet 0/0/0
[DHCP Server-GigabitEthernet0/0/0]ip address 192.168.1.100 24
Jul 19 2024 21:43:07-08:00 DHCP Server %%01IFNET/4/LINK_STATE(l)[0]:The line pro
tocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[DHCP Server-GigabitEthernet0/0/0]quit
[DHCP Server]interface GigabitEthernet 0/0/1
[DHCP Server-GigabitEthernet0/0/1]ip address 192.168.1.200 25
Jul 19 2024 21:47:36-08:00 DHCP Server %%01IFNET/4/LINK_STATE(l)[1]:The line pro
tocol IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[DHCP Server-GigabitEthernet0/0/1]quit
2.telnet客户端与服务器 ip地址配置,telent服务开启,以及远程登录,设置登录账号与密码:
客户端:
[Huawei]interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.2 25
Jul 19 2024 22:21:15-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei]ip route-static 0.0.0.0 0 192.168.1.100
服务端:
[123]interface GigabitEthernet 0/0/0
[123-GigabitEthernet0/0/0]ip a
[123-GigabitEthernet0/0/0]ip add
[123-GigabitEthernet0/0/0]ip address 192.168.1.130 25
Jul 19 2024 22:23:41-08:00 123 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[123]ip route-static 0.0.0.0 0 192.168.1.200
[123]telnet server enable
Error: TELNET server has been enabled
设置登录账号与密码:
[123]user-interface vty 0 4
[123-ui-vty0-4]au
[123-ui-vty0-4]authentication-mode aaa
[123-ui-vty0-4]quit
[123-aaa]local-user admin password cipher admin
[123-aaa]loca
[123-aaa]local-user admin pri
[123-aaa]local-user admin privilege level ?
INTEGER<0-15> Level value
[123-aaa]local-user admin privilege level 15
[123-aaa]lo
[123-aaa]local-user admin ser
[123-aaa]local-user admin service-type tel
[123-aaa]local-user admin service-type telnet
telent客户端远程登录:
3.DHCP服务器排除被手工配置的IP地址,并修改租期时间为1小时:
[DHCP Server-ip-pool-leiyuyang]excluded-ip-address 192.168.1.1 192.168.1.1
[DHCP Server-ip-pool-leiyuyang]excluded-ip-address 192.168.1.2 192.168.1.2
[DHCP Server-ip-pool-leiyuyang]
[DHCP Server-ip-pool-leiyuyang]
[DHCP Server-ip-pool-leiyuyang]lease day 0 hour 1 minute 0
[DHCP Server-ip-pool-leiyuyang2]excluded-ip-address 192.168.1.130 192.168.1.130
[DHCP Server-ip-pool-leiyuyang2]excluded-ip-address 192.168.1.150 192.168.1.150
[DHCP Server-ip-pool-leiyuyang2]excluded-ip-address 192.168.1.180 192.168.1.180
[DHCP Server-ip-pool-leiyuyang]lease day 0 hour 1 minute 0
4.Client-1手工配置IP地址,为192.168.1.1,通过该设备使用域名成功访问HTTP服务器:
5.将pc1与pc2的 ipv4 地址获取方式改为DHCP模式,使DHCP服务器为其自动分配IP地址、网关、掩码、DNS服务器IP地址:
五、测试结果
1.通过DHCP服务,给PC1和PC2分配IP地址、网关、掩码、DNS服务器IP地址:
2.Client-1手工配置IP地址,为192.168.1.1,可以通过该设备使用域名成功访问HTTP服务器:
3.最终实现每台终端都可以相互通讯(ping成功)
telnet客户端:
<Huawei>ping 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=255 time=90 ms
Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=255 time=10 ms
Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=255 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=255 time=10 ms
--- 192.168.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/32/90 ms
<Huawei>ping 192.168.1.
Error: Unknown host 192.168.1..
<Huawei>ping 192.168.1.126
PING 192.168.1.126: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.126: bytes=56 Sequence=1 ttl=128 time=90 ms
Reply from 192.168.1.126: bytes=56 Sequence=2 ttl=128 time=40 ms
Reply from 192.168.1.126: bytes=56 Sequence=3 ttl=128 time=50 ms
Reply from 192.168.1.126: bytes=56 Sequence=4 ttl=128 time=40 ms
Reply from 192.168.1.126: bytes=56 Sequence=5 ttl=128 time=40 ms
--- 192.168.1.126 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/52/90 ms
<Huawei>ping 192.168.1.254
PING 192.168.1.254: 56 data bytes, press CTRL_C to break
Request time out
Reply from 192.168.1.254: bytes=56 Sequence=2 ttl=127 time=90 ms
Reply from 192.168.1.254: bytes=56 Sequence=3 ttl=127 time=60 ms
Reply from 192.168.1.254: bytes=56 Sequence=4 ttl=127 time=80 ms
Reply from 192.168.1.254: bytes=56 Sequence=5 ttl=127 time=80 ms
--- 192.168.1.254 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 60/77/90 ms
<Huawei>ping 192.168.1.150
PING 192.168.1.150: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.150: bytes=56 Sequence=1 ttl=254 time=60 ms
Reply from 192.168.1.150: bytes=56 Sequence=2 ttl=254 time=50 ms
Reply from 192.168.1.150: bytes=56 Sequence=3 ttl=254 time=50 ms
Reply from 192.168.1.150: bytes=56 Sequence=4 ttl=254 time=60 ms
Reply from 192.168.1.150: bytes=56 Sequence=5 ttl=254 time=40 ms
--- 192.168.1.150 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/52/60 ms
<Huawei>ping 192.168.1.180
PING 192.168.1.180: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.180: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 192.168.1.180: bytes=56 Sequence=2 ttl=254 time=60 ms
Reply from 192.168.1.180: bytes=56 Sequence=3 ttl=254 time=50 ms
Reply from 192.168.1.180: bytes=56 Sequence=4 ttl=254 time=60 ms
Reply from 192.168.1.180: bytes=56 Sequence=5 ttl=254 time=40 ms
--- 192.168.1.180 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/48/60 ms
<Huawei>ping 192.168.1.130
PING 192.168.1.130: 56 data bytes, press CTRL_C to break
Request time out
Reply from 192.168.1.130: bytes=56 Sequence=2 ttl=254 time=60 ms
Reply from 192.168.1.130: bytes=56 Sequence=3 ttl=254 time=90 ms
Reply from 192.168.1.130: bytes=56 Sequence=4 ttl=254 time=60 ms
Reply from 192.168.1.130: bytes=56 Sequence=5 ttl=254 time=80 ms
--- 192.168.1.130 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 60/72/90 ms
telnet 服务端:
<Huawei>ping 192.168.1.2
PING 192.168.1.2: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.2: bytes=56 Sequence=1 ttl=254 time=80 ms
Reply from 192.168.1.2: bytes=56 Sequence=2 ttl=254 time=90 ms
Reply from 192.168.1.2: bytes=56 Sequence=3 ttl=254 time=90 ms
Reply from 192.168.1.2: bytes=56 Sequence=4 ttl=254 time=90 ms
Reply from 192.168.1.2: bytes=56 Sequence=5 ttl=254 time=80 ms
--- 192.168.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 80/86/90 ms
<Huawei>ping 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=254 time=70 ms
Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=254 time=70 ms
Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=254 time=50 ms
--- 192.168.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/52/70 ms
<Huawei>ping 192.168.1.126
PING 192.168.1.126: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.126: bytes=56 Sequence=1 ttl=127 time=80 ms
Reply from 192.168.1.126: bytes=56 Sequence=2 ttl=127 time=80 ms
Reply from 192.168.1.126: bytes=56 Sequence=3 ttl=127 time=100 ms
Reply from 192.168.1.126: bytes=56 Sequence=4 ttl=127 time=50 ms
Reply from 192.168.1.126: bytes=56 Sequence=5 ttl=127 time=80 ms
--- 192.168.1.126 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 50/78/100 ms
<Huawei>ping 192.168.1.150
PING 192.168.1.150: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.150: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 192.168.1.150: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 192.168.1.150: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 192.168.1.150: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 192.168.1.150: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 192.168.1.150 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/30/40 ms
<Huawei>ping 192.168.1.180
PING 192.168.1.180: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.180: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 192.168.1.180: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 192.168.1.180: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 192.168.1.180: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 192.168.1.180: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 192.168.1.180 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/34/50 ms
<Huawei>ping 192.168.1.130
PING 192.168.1.130: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.130: bytes=56 Sequence=1 ttl=255 time=1 ms
Reply from 192.168.1.130: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 192.168.1.130: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 192.168.1.130: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 192.168.1.130: bytes=56 Sequence=5 ttl=255 time=1 ms
--- 192.168.1.130 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/1/1 ms
<Huawei>ping 192.168.1.254
PING 192.168.1.254: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.254: bytes=56 Sequence=1 ttl=128 time=90 ms
Reply from 192.168.1.254: bytes=56 Sequence=2 ttl=128 time=50 ms
Reply from 192.168.1.254: bytes=56 Sequence=3 ttl=128 time=50 ms
Reply from 192.168.1.254: bytes=56 Sequence=4 ttl=128 time=50 ms
Reply from 192.168.1.254: bytes=56 Sequence=5 ttl=128 time=40 ms
--- 192.168.1.254 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/56/90 ms
pc1:
PC>ping 192.168.1.1
Ping 192.168.1.1: 32 data bytes, Press Ctrl_C to break
From 192.168.1.1: bytes=32 seq=1 ttl=255 time=15 ms
From 192.168.1.1: bytes=32 seq=2 ttl=255 time=31 ms
From 192.168.1.1: bytes=32 seq=3 ttl=255 time=16 ms
From 192.168.1.1: bytes=32 seq=4 ttl=255 time=16 ms
From 192.168.1.1: bytes=32 seq=5 ttl=255 time=31 ms
--- 192.168.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 15/21/31 ms
PC>ping 192.168.1.2
Ping 192.168.1.2: 32 data bytes, Press Ctrl_C to break
From 192.168.1.2: bytes=32 seq=1 ttl=255 time=47 ms
From 192.168.1.2: bytes=32 seq=2 ttl=255 time=31 ms
From 192.168.1.2: bytes=32 seq=3 ttl=255 time=32 ms
From 192.168.1.2: bytes=32 seq=4 ttl=255 time=46 ms
From 192.168.1.2: bytes=32 seq=5 ttl=255 time=32 ms
--- 192.168.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/37/47 ms
PC>ping 192.168.1.150
Ping 192.168.1.150: 32 data bytes, Press Ctrl_C to break
From 192.168.1.150: bytes=32 seq=1 ttl=254 time=63 ms
From 192.168.1.150: bytes=32 seq=2 ttl=254 time=31 ms
From 192.168.1.150: bytes=32 seq=3 ttl=254 time=63 ms
From 192.168.1.150: bytes=32 seq=4 ttl=254 time=62 ms
From 192.168.1.150: bytes=32 seq=5 ttl=254 time=63 ms
--- 192.168.1.150 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/56/63 ms
PC>ping 192.168.1.180
Ping 192.168.1.180: 32 data bytes, Press Ctrl_C to break
From 192.168.1.180: bytes=32 seq=1 ttl=254 time=63 ms
From 192.168.1.180: bytes=32 seq=2 ttl=254 time=62 ms
From 192.168.1.180: bytes=32 seq=3 ttl=254 time=47 ms
From 192.168.1.180: bytes=32 seq=4 ttl=254 time=63 ms
From 192.168.1.180: bytes=32 seq=5 ttl=254 time=31 ms
--- 192.168.1.180 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/53/63 ms
PC>ping 192.168.1.130
Ping 192.168.1.130: 32 data bytes, Press Ctrl_C to break
From 192.168.1.130: bytes=32 seq=1 ttl=254 time=47 ms
From 192.168.1.130: bytes=32 seq=2 ttl=254 time=62 ms
From 192.168.1.130: bytes=32 seq=3 ttl=254 time=79 ms
From 192.168.1.130: bytes=32 seq=4 ttl=254 time=78 ms
From 192.168.1.130: bytes=32 seq=5 ttl=254 time=78 ms
Client-1:
数据抓包:
pc2:
PC>ping 192.168.1.1
Ping 192.168.1.1: 32 data bytes, Press Ctrl_C to break
From 192.168.1.1: bytes=32 seq=1 ttl=254 time=47 ms
From 192.168.1.1: bytes=32 seq=2 ttl=254 time=62 ms
From 192.168.1.1: bytes=32 seq=3 ttl=254 time=47 ms
From 192.168.1.1: bytes=32 seq=4 ttl=254 time=47 ms
From 192.168.1.1: bytes=32 seq=5 ttl=254 time=31 ms
--- 192.168.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/46/62 ms
PC>ping 192.168.1.126
Ping 192.168.1.126: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.1.126: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.1.126: bytes=32 seq=3 ttl=127 time=94 ms
From 192.168.1.126: bytes=32 seq=4 ttl=127 time=47 ms
From 192.168.1.126: bytes=32 seq=5 ttl=127 time=62 ms
--- 192.168.1.126 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/70/94 ms
PC>ping 192.168.1.2
Ping 192.168.1.2: 32 data bytes, Press Ctrl_C to break
From 192.168.1.2: bytes=32 seq=1 ttl=254 time=63 ms
From 192.168.1.2: bytes=32 seq=2 ttl=254 time=62 ms
From 192.168.1.2: bytes=32 seq=3 ttl=254 time=63 ms
From 192.168.1.2: bytes=32 seq=4 ttl=254 time=62 ms
From 192.168.1.2: bytes=32 seq=5 ttl=254 time=63 ms
--- 192.168.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 62/62/63 ms
PC>ping 192.168.1.150
Ping 192.168.1.150: 32 data bytes, Press Ctrl_C to break
From 192.168.1.150: bytes=32 seq=1 ttl=255 time=15 ms
From 192.168.1.150: bytes=32 seq=2 ttl=255 time=32 ms
From 192.168.1.150: bytes=32 seq=3 ttl=255 time=15 ms
From 192.168.1.150: bytes=32 seq=4 ttl=255 time=15 ms
From 192.168.1.150: bytes=32 seq=5 ttl=255 time=16 ms
--- 192.168.1.150 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 15/18/32 ms
PC>ping 192.168.1.130
Ping 192.168.1.130: 32 data bytes, Press Ctrl_C to break
From 192.168.1.130: bytes=32 seq=1 ttl=255 time=31 ms
From 192.168.1.130: bytes=32 seq=2 ttl=255 time=47 ms
From 192.168.1.130: bytes=32 seq=3 ttl=255 time=47 ms
From 192.168.1.130: bytes=32 seq=4 ttl=255 time=31 ms
From 192.168.1.130: bytes=32 seq=5 ttl=255 time=47 ms
--- 192.168.1.130 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/40/47 ms
PC>ping 192.168.1.180
Ping 192.168.1.180: 32 data bytes, Press Ctrl_C to break
From 192.168.1.180: bytes=32 seq=1 ttl=255 time=16 ms
From 192.168.1.180: bytes=32 seq=2 ttl=255 time=16 ms
From 192.168.1.180: bytes=32 seq=3 ttl=255 time=15 ms
From 192.168.1.180: bytes=32 seq=4 ttl=255 time=16 ms
From 192.168.1.180: bytes=32 seq=5 ttl=255 time=15 ms
DNS服务器:
数据抓包:
HTTP 服务器:
数据抓包: