目录
1.拓扑图
2.实验思路
3.主要配置
4.测试
5.实验总结
1.拓扑图
2.实验思路
- 在配置完RIP和OSPF之后,在2,3号设备上进行多点的双向重发布
- 由于在进行了多点的双向重发布之后,会出现大量的负载均衡,导致选路不佳的问题
- 解决办法:路由策略,干涉选路
3.主要配置
R2:
[r2]rip
[r2-rip-1]version 2
[r2-rip-1]network 12.0.0.0
[r2-rip-1]network 2.0.0.0[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 24.1.1.1 0.0.0.0[r2]rip
[r2-rip-1]import-route ospf 1[r2]ospf 1
[r2-ospf-1]import-route rip针对R1的路由表
[r2]ip ip-prefix 50 permit 5.5.5.0 24
[r2]ip ip-prefix 30 permit 3.3.3.0 24
[r2]ip ip-prefix 34 permit 34.1.1.0 24[r2]route-policy aa permit node 10
[r2-route-policy]if-match ip-prefix 50
[r2-route-policy]apply preference 151
[r2]rip
[r2-rip-1]preference route-policy aa
[r2]route-policy aa permit node 20
[r2-route-policy]if-match ip-prefix 30
[r2-route-policy]apply cost 3[r2]route-policy aa permit node 30
[r2-route-policy]if-match ip-prefix 34
[r2-route-policy]apply cost 3
[r2]route-policy aa permit node 40
[r2-rip-1]import-route ospf route-policy aa
针对R4的路由表:
[r2]ip ip-prefix 12 permit 12.1.1.0 24
[r2]ip ip-prefix 21 permit 2.2.2.0 24[r2]route-policy cc permit node 10
[r2-route-policy]if-match ip-prefix 21
[r2-route-policy]apply cost-type type-1
[r2]route-policy cc permit node 20
[r2-route-policy]if-match ip-prefix 12
[r2-route-policy]apply cost-type type-1
[r2]route-policy cc permit node 30
[r2]ospf 1
[r2-ospf-1]import-route rip route-policy ccR3:
针对R1的路由表:
[r3]ip ip-prefix 50 permit 5.5.5.0 24
[r3]ip ip-prefix 20 permit 2.2.2.0 24
[r3]ip ip-prefix 24 permit 24.1.1.0 24[r3]route-policy bb permit node 10
[r3-route-policy]if-match ip-prefix 50
[r3-route-policy]apply preference 151[r3]rip
[r3-rip-1]preference route-policy bb
[r3]route-policy bb permit node 20
[r3-route-policy]if-match ip-prefix 20
[r3-route-policy]apply cost 3
[r3]route-policy bb permit node 30
[r3-route-policy]if-match ip-prefix 24
[r3-route-policy]apply cost 3
[r3]route-policy bb permit node 40
[r3-rip-1]import-route ospf route-policy bb
[r3]int LoopBack 0
[r3-LoopBack0]ospf network-type broadcast针对R4的路由表:
[r3]ip ip-prefix dd permit 13.1.1.0 24
[r3]route-policy dd permit node 10
[r3-route-policy]if-match ip-prefix dd
[r3-route-policy]apply cost-type type-1
[r3]route-policy dd permit node 20
[r3]ospf 1
[r3-ospf-1]import-route rip route-policy dd
4.测试
5.实验总结
每台路由器都有一个环回地址,2号设备的环回宣告进RIP,3号设备的环回宣告进OSPF,5号设备的环回不宣告进OSPF,后期通过重发布进入。
在RIP和OSPF配置完成之后,先将5号设备的环回重发布进入,然后在2,3号设备上双向重发布。由于5号设备先进行重发布的操作,当信息传都2,3号设备处时,由于2号设备先做重发布的操作,导致去往5号设备环回的环路产生。首先就是破环:我们通过在3号设备上修改优先级达到破环的目的。然后对于1号设备的路由表,需要处理到达3的环回和3-4网段的路由只走下面,到达2号环回和2-4网段只走上面。我们通过前缀列表在控制层面抓取流量,然后在路由策略中针对抓到的流量进行修改度量来达到干涉选路的操作。4号设备同理操作,需要注意的是在路由策略中应该修改类性值,并非修改度量。