要求:
1、R6作为ISP,接口IP地址均为公有地址,该设备只能配置IP地址,之后不能对其进行其他任何配置
2、R1-R5为局域网,私有IP地址为192.168.1.0/24,请合理分配
3、R1、R2、R4各有两个环回地址;R5、R6各有一个环回地址;所有路由器上环回均代表连接用户的接口
4、R3下两台PC通过DHCP自动获取IP地址
5、选路最佳,路由表尽量小,避免环路
6、R1-R5均可以访问R6的环回
7、R6telnetR5的公有IP地址时,实际登录到R1上
8、R4与R5正常通过1000M链路,故障时通过100M链路
分析:
1、分配IP,并配置
分配:
192.168.1.0/27-----R1环回
192.168.1.0/28
192.168.1.16/28
192.168.1.32/27-----R2环回
192.168.1.32/28
192.168.1.48/28
192.168.1.64/27-----R3环回
192.168.1.96/27-----R4环回
192.168.1.96/28
192.168.1.112/28
192.168.1.128/27-----R5环回
192.168.1.160/28-----R1-R2
192.168.1.176/28-----R1-R3
192.168.1.192/28-----R2-R4
192.168.1.208/28-----R3-R4
192.168.1.224/28-----R4-R5(1000M)
192.168.1.240/28-----R4-R5(100M)
配置:
AR1:
[AR1]int g 0/0/0
[AR1-GigabitEthernet0/0/0]ip add 192.168.1.161 28
[AR1-GigabitEthernet0/0/0]int g 0/0/1
[AR1-GigabitEthernet0/0/1]ip add 192.168.1.177 28
[AR1-GigabitEthernet0/0/1]int l 0
[AR1-LoopBack0]ip add 192.168.1.1 28
[AR1-LoopBack0]int l 1
[AR1-LoopBack1]ip add 192.168.1.17 28
AR2:
[AR2]int g 0/0/0
[AR2-GigabitEthernet0/0/0]ip add 192.168.1.162 28
[AR2-GigabitEthernet0/0/0]int g 0/0/1
[AR2-GigabitEthernet0/0/1]ip add 192.168.1.193 28
[AR2-GigabitEthernet0/0/1]int l 0
[AR2-LoopBack0]ip add 192.168.1.33 28
[AR2-LoopBack0]int l 1
[AR2-LoopBack1]ip add 192.168.1.49 28
AR3:
[AR3]int g 0/0/0
[AR3-GigabitEthernet0/0/0]ip add 192.168.1.178 28
[AR3-GigabitEthernet0/0/0]int g 0/0/1
[AR3-GigabitEthernet0/0/1]ip add 192.168.1.209 28
[AR3-GigabitEthernet0/0/1]int g 0/0/2
[AR3-GigabitEthernet0/0/2]ip add 192.168.1.65 27
AR4:
[AR4]int g 0/0/0
[AR4-GigabitEthernet0/0/0]ip add 192.168.1.194 28
[AR4-GigabitEthernet0/0/0]int g 0/0/1
[AR4-GigabitEthernet0/0/1]ip add 192.168.1.210 28
[AR4-GigabitEthernet0/0/1]int g 0/0/2
[AR4-GigabitEthernet0/0/2]ip add 192.168.1.225 28
[AR4-GigabitEthernet0/0/2]int g 4/0/0
[AR4-GigabitEthernet4/0/0]ip add 192.168.1.241 28
[AR4-GigabitEthernet4/0/0]int l 0
[AR4-LoopBack0]ip add 192.168.1.97 28
[AR4-LoopBack0]int l 1
[AR4-LoopBack1]ip add 192.168.1.113 28
AR5:
[AR5]int g 0/0/0
[AR5-GigabitEthernet0/0/0]ip add 192.168.1.226 28
[AR5-GigabitEthernet0/0/0]int g 0/0/1
[AR5-GigabitEthernet0/0/1]ip add 12.0.0.1 24
[AR5-GigabitEthernet0/0/1]int g 0/0/2
[AR5-GigabitEthernet0/0/2]ip add 192.168.1.242 28
[AR5-GigabitEthernet0/0/2]int l 0
[AR5-LoopBack0]ip add 192.168.1.129 27
AR6:
[AR6]int g 0/0/0
[AR6-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[AR6-GigabitEthernet0/0/0]int l 0
[AR6-LoopBack0]ip add 1.1.1.1 24
2、给PC1、PC2配置DHCP获取地址
配置:
AR3:
[AR3]ip pool tqss
[AR3-ip-pool-tqss]network 192.168.1.64 mask 27
[AR3-ip-pool-tqss]gateway-list 192.168.1.65
[AR3-ip-pool-tqss]dns-list 114.114.114.114
[AR3-ip-pool-tqss]q
[AR3]int g 0/0/2
[AR3-GigabitEthernet0/0/2]dhcp select global
结果:
PC1:![](https://i-blog.csdnimg.cn/blog_migrate/c1c1666dc99f7e9628506f71c7ab3fb9.png)
PC2: ![](https://i-blog.csdnimg.cn/blog_migrate/76c6aef7e260a68a4389ccc2ace43ba3.png)
3、配置静态路由使得全网可达,并且R4-R5是浮动静态路由,R1-R5都可以访问R6的环回
配置:
AR1:
R2-R4:
[AR1]ip route-static 192.168.1.192 28 192.168.1.162
R2环回:
[AR1]ip route-static 192.168.1.32 27 192.168.1.162
R3-R4:
[AR1]ip route-static 192.168.1.208 28 192.168.1.178
R3环回:
[AR1]ip route-static 192.168.1.64 27 192.168.1.178R4环回:
[AR1]ip route-static 192.168.1.96 27 192.168.1.178
[AR1]ip route-static 192.168.1.96 27 192.168.1.162R4-R5(1000):
[AR1]ip route-static 192.168.1.224 28 192.168.1.162
[AR1]ip route-static 192.168.1.224 28 192.168.1.178R4-R5(100):
[AR1]ip route-static 192.168.1.240 28 192.168.1.162
[AR1]ip route-static 192.168.1.240 28 192.168.1.178R5环回:
[AR1]ip route-static 192.168.1.128 27 192.168.1.162
[AR1]ip route-static 192.168.1.128 27 192.168.1.178缺省:
[AR1]ip route-static 0.0.0.0 0 192.168.1.178
[AR1]ip route-static 0.0.0.0 0 192.168.1.162
AR2:
R1环回:
[AR2]ip route-static 192.168.1.0 27 192.168.1.161
R1-R3:
[AR2]ip route-static 192.168.1.176 28 192.168.1.161
R3环回:
[AR2]ip route-static 192.168.1.64 27 192.168.1.161
[AR2]ip route-static 192.168.1.64 27 192.168.1.194
R3-R4:
[AR2]ip route-static 192.168.1.208 28 192.168.1.194
R4环回:
[AR2]ip route-static 192.168.1.96 27 192.168.1.194
R4-R5(1000):
[AR2]ip route-static 192.168.1.224 28 192.168.1.194
[AR2]ip route-static 192.168.1.240 28 192.168.1.194
R5环回:
[AR2]ip route-static 192.168.1.128 27 192.168.1.194
缺省:
[AR2]ip route-static 0.0.0.0 0 192.168.1.194
AR3:
R1环回:
[AR3]ip route-static 192.168.1.0 27 192.168.1.177
R1-R2:
[AR3]ip route-static 192.168.1.160 28 192.168.1.177
R2环回:
[AR3]ip route-static 192.168.1.32 27 192.168.1.177
[AR3]ip route-static 192.168.1.32 27 192.168.1.210R2-R4:
[AR3]ip route-static 192.168.1.192 28 192.168.1.210
R4环回:
[AR3]ip route-static 192.168.1.96 27 192.168.1.210
R4-R5(1000):
[AR3]ip route-static 192.168.1.224 28 192.168.1.210
R4-R5(100):
[AR3]ip route-static 192.168.1.240 28 192.168.1.210
R5环回:
[AR3]ip route-static 192.168.1.128 27 192.168.1.210
缺省:
[AR3]ip route-static 0.0.0.0 0 192.168.1.210
AR4:
R1环回:
[AR4]ip route-static 192.168.1.0 27 192.168.1.193
[AR4]ip route-static 192.168.1.0 27 192.168.1.209R1-R2:
[AR4]ip route-static 192.168.1.160 28 192.168.1.193
R1-R3:
[AR4]ip route-static 192.168.1.176 28 192.168.1.209
R2环回:
[AR4]ip route-static 192.168.1.32 27 192.168.1.193
R3环回:
[AR4]ip route-static 192.168.1.64 27 192.168.1.209
R5环回(1000):
[AR4]ip route-static 192.168.1.128 27 192.168.1.226
R5环回(100):
[AR4]ip route-static 192.168.1.128 28 192.168.1.242 preference 70
缺省:
[AR4]ip route-static 0.0.0.0 0 192.168.1.226
[AR4]ip route-static 0.0.0.0 0 192.168.1.242 preference 70
AR5:
R1环回:
[AR5]ip route-static 192.168.1.0 27 192.168.1.225
[AR5]ip route-static 192.168.1.0 27 192.168.1.241 preference 70
R1-R2:
[AR5]ip route-static 192.168.1.160 28 192.168.1.225
[AR5]ip route-static 192.168.1.160 28 192.168.1.241 preference 70R1-R3:
[AR5]ip route-static 192.168.1.176 28 192.168.1.225
[AR5]ip route-static 192.168.1.176 28 192.168.1.241 preference 70R2环回:
[AR5]ip route-static 192.168.1.32 27 192.168.1.225
[AR5]ip route-static 192.168.1.32 27 192.168.1.241 preference 70
R3环回:
[AR5]ip route-static 192.168.1.64 27 192.168.1.225
[AR5]ip route-static 192.168.1.64 27 192.168.1.241 preference 70R2-R4:
[AR5]ip route-static 192.168.1.192 28 192.168.1.225
[AR5]ip route-static 192.168.1.192 28 192.168.1.241 preference 70R3-R5:
[AR5]ip route-static 192.168.1.208 28 192.168.1.225
[AR5]ip route-static 192.168.1.208 28 192.168.1.241 preference 70R4环回:
[AR5]ip route-static 192.168.1.96 27 192.168.1.225
[AR5]ip route-static 192.168.1.96 27 192.168.1.241 preference 70缺省:
[AR5]ip route-static 0.0.0.0 0 12.0.0.2
测试:
AR1:![](https://i-blog.csdnimg.cn/blog_migrate/74703ca704fb76af76eec2bdd546656b.png)
AR2:![](https://i-blog.csdnimg.cn/blog_migrate/0506ff47339e4ebb2635529ca5471cc5.png)
![](https://i-blog.csdnimg.cn/blog_migrate/1794eeba03f0e3a90296bc7fcbe1cb9f.png)
![](https://i-blog.csdnimg.cn/blog_migrate/e70da0ea2b9ccf9fc21c55b9e2137b81.png)
![](https://i-blog.csdnimg.cn/blog_migrate/4d84f71a90691b2a4782cd9e1319809d.png)
![](https://i-blog.csdnimg.cn/blog_migrate/45eb0ab83d7fee7c83cf4bbe8d7fe0c6.png)
![](https://i-blog.csdnimg.cn/blog_migrate/4f8409a79aa7ef9a54b0f5167dc42af2.png)
![](https://i-blog.csdnimg.cn/blog_migrate/28e956994e8faacdfaa9af66a7145d06.png)
AR3:![](https://i-blog.csdnimg.cn/blog_migrate/3015f90412a7e30608d9070fea6f81ce.png)
![](https://i-blog.csdnimg.cn/blog_migrate/357f55b1597f230a1f31974e51158907.png)
![](https://i-blog.csdnimg.cn/blog_migrate/3d2ed1260cfc2855e928e933d9e1a104.png)
![](https://i-blog.csdnimg.cn/blog_migrate/4aba4135593a4026d7ef10bf606ec413.png)
AR4:![](https://i-blog.csdnimg.cn/blog_migrate/488c3609a6e5cc54b5af29286b74217c.png)
![](https://i-blog.csdnimg.cn/blog_migrate/3d45593b818ca6db3580a104d0febd61.png)
AR5:![](https://i-blog.csdnimg.cn/blog_migrate/f7ebde94855614a4a782649d9cb4370e.png)
4、R1为telnet服务器,并映射到R5上
配置:
AR1:
[AR1]user-interface vty 0 4
[AR1-ui-vty0-4]authentication-mode aaa
[AR1-aaa]local-user huawei password cipher 123456
[AR1-aaa]local-user huawei privilege level 15
[AR1-aaa]local-user huawei service-type telnet
AR5:
[AR5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 114 i
nside 192.168.1.161 23
Warning:The port 114 is well-known port. If you continue it may cause function f
ailure.
Are you sure to continue?[Y/N]:y