拓扑图
需求
需求:
1、通过DHCP服务,给PC4和PC5分配IP地址、网关、掩码、DNS服务器IP地址
2、Client-1要求手工配置IP地址,为192.168.1.1,可以通过该设备使用域名成功访问HTTP服务器
3、telnet客户端可以远程登录telnet服务器进行设备管理,并成功修改telnet服务器的名称为123
telnet设备登录的账号密码为:admin/admin
4、要求DHCP服务器需要排除被手工配置的IP地址;并修改租期时间为1小时;
5、最终实现每台终端都可以相互通讯(ping成功)
6、整个拓扑图使用192.168.1.0/24网段进行分配
需求分析
一.进行子网分配
二.配置路由器,建立IP地址池塘
三.把配置过的IP地址排除,根据命令修改租期时间
四.配置各个服务器,配置域名解析
五.根据telnet协议进行路由器配置,设置一个认证模式
六.各个终端都可以ping通
过程
telent服务器
配置ip
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname telnet2
[telnet2]int g 0/0/0
[telnet2-GigabitEthernet0/0/0]ip address 192.168.1.152 25
Jul 20 2024 22:04:26-08:00 telnet2 %%01IFNET/4/LINK_STATE(l)[0]:The line protoco
l IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[telnet2-GigabitEthernet0/0/0]q
补充理由表
[telnet2]ip route-static 0.0.0.0 0 192.168.1.200
进行telnet的配置
[telnet2]telnet server enable
Error: TELNET server has been enabled
[telnet2]user-interface vty 0 4
[telnet2-ui-vty0-4]authentication-mode aaa
[telnet2-ui-vty0-4]q
[telnet2]aaa
[telnet2-aaa]local-user 123 password cipher admin
Info: Add a new user.
[telnet2-aaa]local-user wangyu privilege level ?
INTEGER<0-15> Level value
[telnet2-aaa]local-user wangyu privilege level 15
Info: Add a new user.
[telnet2-aaa]local-user wangyu service-type telnet
[telnet2-aaa]q
telent客户端
配置IP
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname telnet
[telnet]int g 0/0/0
[telnet-GigabitEthernet0/0/0]ip address 192.168.1.2 25
[telnet-GigabitEthernet0/0/0]
Jul 20 2024 22:01:33-08:00 telnet %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[telnet-GigabitEthernet0/0/0]q
补充理由表
[telnet]ip route-static 0.0.0.0 0 192.168.1.100
[telnet]q
DHCP服务器
配置IP
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname DHCP
[DHCP]int g 0/0/0
[DHCP-GigabitEthernet0/0/0]ip address 192.168.1.100 25
Jul 20 2024 21:27:32-08:00 DHCP %%01IFNET/4/LINK_STATE(l)[0]:The line protocol I
P on the interface GigabitEthernet0/0/0 has entered the UP state.
[DHCP-GigabitEthernet0/0/0]q
[DHCP]int g 0/0/1
[DHCP-GigabitEthernet0/0/1]ip address 192.168.1.200 25
[DHCP-GigabitEthernet0/0/1]
Jul 20 2024 21:27:57-08:00 DHCP %%01IFNET/4/LINK_STATE(l)[1]:The line protocol I
P on the interface GigabitEthernet0/0/1 has entered the UP state.
[DHCP-GigabitEthernet0/0/1]q
启动DHCP服务
[DHCP]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
配置DHCP待分配的IP地址池塘
[DHCP]ip pool abc
Info: It's successful to create an IP address pool.
[DHCP-ip-pool-abc]network 192.168.1.0 mask 25
[DHCP-ip-pool-abc]gateway-list 192.168.1.100
[DHCP-ip-pool-abc]dns-list 8.8.8.8
[DHCP-ip-pool-abc]q
[DHCP]interface GigabitEthernet 0/0/0
[DHCP-GigabitEthernet0/0/0]dhcp select global
[DHCP-GigabitEthernet0/0/0]q
[DHCP]ip pool cbd
Info: It's successful to create an IP address pool.
[DHCP-ip-pool-cbd]network 192.168.1.129 mask 25
[DHCP-ip-pool-cbd]gateway-list 192.168.1.200
[DHCP-ip-pool-cbd]dns-list 8.8.8.8
[DHCP-ip-pool-cbd]q
[DHCP]interface GigabitEthernet 0/0/1
[DHCP-GigabitEthernet0/0/1]dhcp select global
[DHCP-GigabitEthernet0/0/1]q
[DHCP]
排除ip
[DHCP]ip pool cbd
[DHCP-ip-pool-cbd]excluded-ip-address 192.168.1.150 192.168.1.152
[DHCP-ip-pool-cbd]q
[DHCP]ip pool abc
[DHCP-ip-pool-abc]excluded-ip-address 192.168.1.1 192.168.1.2
[DHCP-ip-pool-abc]
修改租期时间为1小时
[DHCP]ip pool cbd
[DHCP-ip-pool-cbd]lease day 0 hour 1 minute 0
[DHCP-ip-pool-cbd]
[DHCP]ip pool abc
[DHCP-ip-pool-abc]lease day 0 hour 1 minute 0
[DHCP-ip-pool-abc]
telent客户端登陆服务器
<telnet>telnet 192.168.1.152
Press CTRL_] to quit telnet mode
Trying 192.168.1.152 ...
Connected to 192.168.1.152 ...
Login authentication
Username:123
Password:
<telnet2>
PC4
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=47 ms
From 192.168.1.150: bytes=32 seq=2 ttl=254 time=32 ms
From 192.168.1.150: bytes=32 seq=3 ttl=254 time=31 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/47/63 ms
PC>ping 192.168.1.151
Ping 192.168.1.151: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.1.151: bytes=32 seq=2 ttl=254 time=63 ms
From 192.168.1.151: bytes=32 seq=3 ttl=254 time=47 ms
From 192.168.1.151: bytes=32 seq=4 ttl=254 time=62 ms
From 192.168.1.151: bytes=32 seq=5 ttl=254 time=63 ms
--- 192.168.1.151 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/58/63 ms
PC>ping 192.168.1.152
Ping 192.168.1.152: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.1.152: bytes=32 seq=2 ttl=254 time=78 ms
From 192.168.1.152: bytes=32 seq=3 ttl=254 time=79 ms
From 192.168.1.152: bytes=32 seq=4 ttl=254 time=78 ms
From 192.168.1.152: bytes=32 seq=5 ttl=254 time=47 ms
--- 192.168.1.152 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/70/79 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=47 ms
From 192.168.1.2: bytes=32 seq=3 ttl=255 time=31 ms
From 192.168.1.2: bytes=32 seq=4 ttl=255 time=31 ms
From 192.168.1.2: bytes=32 seq=5 ttl=255 time=47 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/40/47 ms
PC>ping 192.168.1.254
Ping 192.168.1.254: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.1.254: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.1.254: bytes=32 seq=3 ttl=127 time=78 ms
From 192.168.1.254: bytes=32 seq=4 ttl=127 time=62 ms
From 192.168.1.254: bytes=32 seq=5 ttl=127 time=78 ms
--- 192.168.1.254 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/74/78 ms
PC>
PC5
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=78 ms
From 192.168.1.1: bytes=32 seq=2 ttl=254 time=47 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=63 ms
From 192.168.1.1: bytes=32 seq=5 ttl=254 time=46 ms
--- 192.168.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 46/56/78 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=47 ms
From 192.168.1.126: bytes=32 seq=3 ttl=127 time=78 ms
From 192.168.1.126: bytes=32 seq=4 ttl=127 time=78 ms
From 192.168.1.126: bytes=32 seq=5 ttl=127 time=79 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/79 ms
PC>ping 192.168.1.2
Ping 192.168.1.2: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.1.2: bytes=32 seq=2 ttl=254 time=63 ms
From 192.168.1.2: bytes=32 seq=3 ttl=254 time=78 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
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/66/78 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=16 ms
From 192.168.1.150: bytes=32 seq=2 ttl=255 time=15 ms
From 192.168.1.150: bytes=32 seq=3 ttl=255 time=16 ms
From 192.168.1.150: bytes=32 seq=4 ttl=255 time<1 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 = 0/12/16 ms
PC>ping 192.168.1.151
Ping 192.168.1.151: 32 data bytes, Press Ctrl_C to break
From 192.168.1.151: bytes=32 seq=1 ttl=255 time=16 ms
From 192.168.1.151: bytes=32 seq=2 ttl=255 time=16 ms
From 192.168.1.151: bytes=32 seq=3 ttl=255 time=15 ms
From 192.168.1.151: bytes=32 seq=4 ttl=255 time=16 ms
From 192.168.1.151: bytes=32 seq=5 ttl=255 time=31 ms
--- 192.168.1.151 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 15/18/31 ms
PC>ping 192.168.1.152
Ping 192.168.1.152: 32 data bytes, Press Ctrl_C to break
From 192.168.1.152: bytes=32 seq=1 ttl=255 time=32 ms
From 192.168.1.152: bytes=32 seq=2 ttl=255 time=46 ms
From 192.168.1.152: bytes=32 seq=3 ttl=255 time=32 ms
From 192.168.1.152: bytes=32 seq=4 ttl=255 time=31 ms
From 192.168.1.152: bytes=32 seq=5 ttl=255 time=31 ms
--- 192.168.1.152 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/34/46 ms
PC>
client
DNS
http
telent客户端ping
telent服务器