拓扑图:
实验需求:
1.整张网络使用192.168.1.0/24网段进行划分
2.R1、R2、R3、R4均有两个环回来模拟用户网段
3.R5使用DHCP为PC分配IP网段
4.R2、R3、R4、R5开启Telnet功能;账号密码:admin/admin
5.完成所有路由器的静态路由配置,要求使用最简化路由表的方式
6.全网可达
需求分析:
1.子网划分
2.环回路由
3.DHCP
4.Telnet
5.静态路由
6.全网通
实验配置:
-
1.子网划分
子网划分:192.168.1.0/24
1.先忽略环回进行划分:--7个网段
192.168.1.000 00000----192.168.1.0/27----192.168.1.31/27
192.168.1.001 00000----192.168.1.32/27---192.168.1.63/27
192.168.1.010 00000----192.168.1.64/27---192.168.1.95/27
192.168.1.011 00000----192.168.1.96/27---192.168.1.127/27
192.168.1.100 00000----192.168.1.128/27--192.168.1.159/27
192.168.1.101 00000----192.168.1.160/27--192.168.1.191/27
192.168.1.110 00000----192.168.1.192/27--192.168.1.223/27
192.168.1.111 00000----192.168.1.224/27--192.168.1.255/27
2.环回路由产生了8个网段,对上面第8个闲置的网段进行拆分:
192.168.1.111 000 00----192.168.1.224/30--192.168.1.227/30
192.168.1.111 001 00----192.168.1.228/30--192.168.1.231/30
192.168.1.111 010 00----192.168.1.232/30--192.168.1.235/30
192.168.1.111 011 00----192.168.1.236/30--192.168.1.239/30
192.168.1.111 100 00----192.168.1.240/30--192.168.1.243/30
192.168.1.111 101 00----192.168.1.244/30--192.168.1.247/30
192.168.1.111 110 00----192.168.1.248/30--192.168.1.251/30
192.168.1.111 111 00----192.168.1.252/30--192.168.1.255/30
设置网关
AR1:
192.168.1.1/27
192.168.1.65/27
AR2:
192.168.1.2/27
192.168.1.33/27
AR3:
192.168.1.66/27
192.168.1.97/27
AR4:
192.168.1.34/27
192.168.1.98/27
192.168.1.129/27
192.168.1.161/27
AR5:
192.168.1.130/27
192.168.1.162/27
192.168.1.193/27
-
2.环回路由
AR1:
192.168.1.225/30
192.168.1.229/30
AR2:
192.168.1.233/30
192.168.1.237/30
AR3:
192.168.1.241/30
192.168.1.245/30
AR4:
192.168.1.249/30
192.168.1.253/30
-
3.DHCP配置
[Huawei]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]ip pool A
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-A]network 192.168.1.192 mask 27
[Huawei-ip-pool-A]gateway-list 192.168.1.193
[Huawei-ip-pool-A]quit
[Huawei]interface g 0/0/2
[Huawei-GigabitEthernet0/0/2]dhcp select global
-
4.Telnet配置
- Telnet服务器设置--以AR2为例:
[Huawei]sysname Telnet Server
[Telnet Server]telnet server enable
Error: TELNET server has been enabled
[Telnet Server]user-interface vty 0 4
[Telnet Server-ui-vty0-4]authentication-mode aaa
[Telnet Server-ui-vty0-4]quit
[Telnet Server]aaa
[Telnet Server-aaa]local-user admin password cipher admin privilege level 15
这条命令把之前的两条命名合并了
[Telnet Server-aaa]local-user admin service-type telnet
- Telnet客户端设置--AR1:
<Huawei>telnet 192.168.1.2
Press CTRL_] to quit telnet mode
Trying 192.168.1.2 ...
Connected to 192.168.1.2 ...
Login authentication
Username:admin
Password:
<Telnet Server>
注意:要想连接AR4和AR5的话需要先配置静态路由!
-
5.静态路由
[Huawei]display this--查看该界面下的操作
AR1:
ip route-static 192.168.1.32 255.255.255.224 192.168.1.2
ip route-static 192.168.1.96 255.255.255.224 192.168.1.66
ip route-static 192.168.1.128 255.255.255.224 192.168.1.2
ip route-static 192.168.1.128 255.255.255.224 192.168.1.66
ip route-static 192.168.1.160 255.255.255.224 192.168.1.2 preference 90
ip route-static 192.168.1.160 255.255.255.224 192.168.1.66 preference 90
ip route-static 192.168.1.192 255.255.255.224 192.168.1.2
ip route-static 192.168.1.192 255.255.255.224 192.168.1.66
ip route-static 192.168.1.232 255.255.255.248 192.168.1.2
ip route-static 192.168.1.240 255.255.255.248 192.168.1.66
ip route-static 192.168.1.248 255.255.255.248 192.168.1.2
ip route-static 192.168.1.248 255.255.255.248 192.168.1.66
AR2:
ip route-static 192.168.1.64 255.255.255.224 192.168.1.1
ip route-static 192.168.1.128 255.255.255.224 192.168.1.34
ip route-static 192.168.1.160 255.255.255.224 192.168.1.34 preference 90
ip route-static 192.168.1.192 255.255.255.224 192.168.1.34
ip route-static 192.168.1.224 255.255.255.248 192.168.1.1
ip route-static 192.168.1.240 255.255.255.248 192.168.1.1
ip route-static 192.168.1.248 255.255.255.248 192.168.1.34
AR3:
ip route-static 192.168.1.0 255.255.255.224 192.168.1.65
ip route-static 192.168.1.128 255.255.255.224 192.168.1.98
ip route-static 192.168.1.160 255.255.255.224 192.168.1.98 preference 90
ip route-static 192.168.1.192 255.255.255.224 192.168.1.98
ip route-static 192.168.1.224 255.255.255.248 192.168.1.65
ip route-static 192.168.1.232 255.255.255.248 192.168.1.65
ip route-static 192.168.1.248 255.255.255.248 192.168.1.98
AR4:
ip route-static 192.168.1.0 255.255.255.224 192.168.1.33
ip route-static 192.168.1.64 255.255.255.224 192.168.1.97
ip route-static 192.168.1.192 255.255.255.224 192.168.1.130
ip route-static 192.168.1.192 255.255.255.224 192.168.1.162
ip route-static 192.168.1.224 255.255.255.248 192.168.1.33
ip route-static 192.168.1.224 255.255.255.248 192.168.1.97
ip route-static 192.168.1.232 255.255.255.248 192.168.1.33
ip route-static 192.168.1.240 255.255.255.248 192.168.1.97
AR5:
ip route-static 192.168.1.0 255.255.255.224 192.168.1.129
ip route-static 192.168.1.0 255.255.255.224 192.168.1.161
ip route-static 192.168.1.32 255.255.255.224 192.168.1.129
ip route-static 192.168.1.32 255.255.255.224 192.168.1.161
ip route-static 192.168.1.64 255.255.255.224 192.168.1.129
ip route-static 192.168.1.64 255.255.255.224 192.168.1.161
ip route-static 192.168.1.96 255.255.255.224 192.168.1.129
ip route-static 192.168.1.96 255.255.255.224 192.168.1.161
ip route-static 192.168.1.224 255.255.255.248 192.168.1.129
ip route-static 192.168.1.224 255.255.255.248 192.168.1.161
ip route-static 192.168.1.232 255.255.255.248 192.168.1.129
ip route-static 192.168.1.232 255.255.255.248 192.168.1.161
ip route-static 192.168.1.240 255.255.255.248 192.168.1.161
ip route-static 192.168.1.240 255.255.255.248 192.168.1.129
ip route-static 192.168.1.248 255.255.255.248 192.168.1.129
-
6.全网通
以AR2为例:
[Huawei]ping -a 192.168.1.233 192.168.1.225
PING 192.168.1.225: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.225: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 192.168.1.225: bytes=56 Sequence=2 ttl=255 time=20 ms
[Huawei]ping -a 192.168.1.233 192.168.1.241
PING 192.168.1.241: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.241: bytes=56 Sequence=1 ttl=254 time=110 ms
Reply from 192.168.1.241: bytes=56 Sequence=2 ttl=254 time=90 ms
[Huawei]ping -a 192.168.1.233 192.168.1.249
PING 192.168.1.249: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.249: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 192.168.1.249: bytes=56 Sequence=2 ttl=255 time=30 ms
[Huawei]ping -a 192.168.1.233 192.168.1.221
PING 192.168.1.221: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.221: bytes=56 Sequence=1 ttl=126 time=70 ms
Reply from 192.168.1.221: bytes=56 Sequence=2 ttl=126 time=60 ms