目录
4.缺省路由配置---解决问题三:R1-R4上不能直接编写到达5.5.5.0/24的静态路由,但依然可以访问。
6.解决问题五---R4与R5之间,正常1000m链路通信,故障时自动改为100M。
实验题目及要求:
实验步骤:
1.实现IP地址划分:
骨干IP使用/30避免了浪费,因为每个骨干链路只需要两个IP
需要配置8个环回使用/27进行手工汇总成4个网段
2.各接口IP:
1)环回接口
R1:
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 192.168.1.33 28
[r1-LoopBack0]q
[r1]interface LoopBack 1
[r1-LoopBack1]ip address 192.168.1.49 28
R2:
[r2]interface LoopBack 0
[r2-LoopBack0]ip address 192.168.1.65 28
[r2-LoopBack0]q
[r2]interface LoopBack 1
[r2-LoopBack1]ip address 192.168.1.81 28
R3:
[r3]interface LoopBack 0
[r3-LoopBack0]ip address 192.168.1.97 28
[r3-LoopBack0]q
[r3]interface LoopBack 1
[r3-LoopBack1]ip address 192.168.1.113 28
R4:
[r4]interface LoopBack 0
[r4-LoopBack0]ip address 192.168.1.129 28
[r4-LoopBack0]q
[r4]interface LoopBack 1
[r4-LoopBack1]ip address 192.168.1.145 28
R5:
[r5]interface LoopBack 0
[r5-LoopBack0]ip address 5.5.5.1 24
2)路由器接口
R1:
[r1]interface g0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.1.1 30
[r1-GigabitEthernet0/0/1]q[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.5 30
R2:
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[r2-GigabitEthernet0/0/0]interface g0/0/1
[r2-GigabitEthernet0/0/1]ip address 192.168.1.9 30
R3:
[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[r3-GigabitEthernet0/0/0]interface g0/0/1
[r3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
R4:
[r4]interface g0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[r4-GigabitEthernet0/0/0]interface g0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.168.1.17 30
[r4-GigabitEthernet0/0/1]interface g0/0/2
[r4-GigabitEthernet0/0/2]ip address 192.168.1.14 30
[r4-GigabitEthernet0/0/2]interface g4/0/0
[r4-GigabitEthernet4/0/0]ip address 192.168.1.21 30
R5:
[r5]interface g0/0/0
[r5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[r5-GigabitEthernet0/0/0]interface g0/0/1
[r5-GigabitEthernet0/0/1]ip address 192.168.1.22 30
3)检查
R1:
R2:
R3:
R4:
R5:
3.静态路由配置---实现全网可达
R1:
[r1]ip route-static 192.168.1.8 30 192.168.1.2
[r1]ip route-static 192.168.1.12 30 192.168.1.6
[r1]ip route-static 192.168.1.16 30 192.168.1.6
[r1]ip route-static 192.168.1.16 30 192.168.1.2
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.96 27 192.168.1.6
[r1]ip route-static 192.168.1.128 27 192.168.1.6
[r1]ip route-static 192.168.1.128 27 192.168.1.2
R2:
[r2]ip route-static 192.168.1.4 30 192.168.1.1
[r2]ip route-static 192.168.1.12 30 192.168.1.10
[r2]ip route-static 192.168.1.16 30 192.168.1.10[r2]ip route-static 192.168.1.32 27 192.168.1.1
[r2]ip route-static 192.168.1.96 27 192.168.1.1
[r2]ip route-static 192.168.1.96 27 192.168.1.10
[r2]ip route-static 192.168.1.128 27 192.168.1.10
R3:
[r3]ip route-static 192.168.1.0 30 192.168.1.5
[r3]ip route-static 192.168.1.8 30 192.168.1.14
[r3]ip route-static 192.168.1.16 30 192.168.1.14[r3]ip route-static 192.168.1.32 27 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.14
[r3]ip route-static 192.168.1.128 27 192.168.1.14
R4:
[r4]ip route-static 192.168.1.0 30 192.168.1.9
[r4]ip route-static 192.168.1.4 30 192.168.1.13
[r4]ip route-static 192.168.1.32 27 192.168.1.9
[r4]ip route-static 192.168.1.32 27 192.168.1.13
[r4]ip route-static 192.168.1.64 27 192.168.1.9
[r4]ip route-static 192.168.1.96 27 192.168.1.13
R5:
[r5]ip route-static 192.168.1.0 30 192.168.1.17
[r5]ip route-static 192.168.1.4 30 192.168.1.17
[r5]ip route-static 192.168.1.8 30 192.168.1.17
[r5]ip route-static 192.168.1.12 30 192.168.1.17
[r5]ip route-static 192.168.1.32 27 192.168.1.17
[r5]ip route-static 192.168.1.64 27 192.168.1.17
[r5]ip route-static 192.168.1.96 27 192.168.1.17
[r5]ip route-static 192.168.1.128 27 192.168.1.17
4.缺省路由配置---解决问题三:R1-R4上不能直接编写到达5.5.5.0/24的静态路由,但依然可以访问。
[r1]ip route-static 0.0.0.0 0 192.168.1.2
[r1]ip route-static 0.0.0.0 0 192.168.1.6
[r2]ip route-static 0.0.0.0 0 192.168.1.10
[r3]ip route-static 0.0.0.0 0 192.168.1.14
[r4]ip route-static 0.0.0.0 0 192.168.1.18
5.防环---避免环路出现
[r1]ip route-static 192.168.1.32 27 null 0
[r2]ip route-static 192.168.1.64 27 null 0
[r3]ip route-static 192.168.1.96 27 null 0
[r4]ip route-static 192.168.1.128 27 null 0
测试:
6.解决问题五---R4与R5之间,正常1000m链路通信,故障时自动改为100M。
r4--->r5:
给R4-R5之间的另一条链路配置为备份链路,优先级为61:
[r4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
r5--->r4:输出备份
[r5]ip route-static 192.168.1.0 30 192.168.1.17 preference 61
[r5]ip route-static 192.168.1.4 30 192.168.1.17 preference 61
[r5]ip route-static 192.168.1.8 30 192.168.1.17 preference 61
[r5]ip route-static 192.168.1.12 30 192.168.1.17 preference 61
[r5]ip route-static 192.168.1.32 27 192.168.1.17 preference 61
[r5]ip route-static 192.168.1.64 27 192.168.1.17 preference 61
[r5]ip route-static 192.168.1.96 27 192.168.1.17 preference 61
[r5]ip route-static 192.168.1.128 27 192.168.1.17 preference 61
测试:
查看路由表:关闭1000M之后,路由表优先级已变为61
1000M恢复后:
总结:
本次实验用到了负载均衡、环回接口配置、一个网段分配IP地址、手工汇总IP地址、缺省路由、空接口防环路由(避免环路)、浮动静态路由(备份)。