拓扑图
路由分配
R1环回为 1.1.1.1
R2环回为2.2.2.2
........
R1--R2 12.1.1.0 24
R2-R3 23.1.1.0 24
.........
命令 :
R1重发布
[r1-ospf-1]import-route direct
R4重发布
[r4-rip-1]import-route ospf 1
[r4-ospf-1]import-route rip 1
路由控制
[r4]ip ip-prefix b1 permit 5.5.5.0 24
[r4]ip ip-prefix b1 permit 56.1.1.0 24
[r4]route-policy os permit node 10
[r4-route-policy]if-match ip-prefix b1
[r4-route-policy]apply cost 2
[r4]route-policy os permit node 20
[r4-ospf-1]import-route rip 1 route-policy os
[r4]ip ip-prefix b3 permit 35.1.1.0 24
[r4]route-policy rip permit node 10
[r4-route-policy]if-match ip-prefix b3
[r4-route-policy]apply cost 2
[r4]route-policy rip permit node 20
[r4-rip-1]import-route ospf 1 route-policy rip
修改环回接口网络类型
[r4-LoopBack0]ospf network-type broadcast
R5重发布
[r5-rip-1]import-route ospf 1
[r5-ospf-1]import-route rip 1
路由控制
[r5]ip ip-prefix b2 permit 46.1.1.0 24
[r5]route-policy os permit node 10
[r5-route-policy]if-match ip-prefix b2
[r5-route-policy]apply cost 2
[r5]route-policy os permit node 20
[r5-ospf-1]import-route rip 1 route-policy os
[r5]ip ip-prefix b4 permit 4.4.4.0 24
[r5]ip ip-prefix b4 permit 34.1.1.0 24
[r5]route-policy rip permit node 10
[r5-route-policy]if-match ip-prefix b4
[r5-route-policy]apply cost 2
[r5]route-policy rip permit node 20
[r5-rip-1]import-route ospf 1 route-policy rip
成环的原因
成环原因:首先R3.R4,R5根据五类LSA学到 R1环回接口路由其优先级为150 cost值为类型二种子度量值为1 ,R4加表以后进行双向重发布将R1环回接口路由发送给R6 R6加表后传给R5,由于RIP协议域外学到路由优先级为100小于150 所以R5传往1.1.1.1 的数据将会先发给R6, R5将学来的域外路由传给R3,R3只运行ospf协议 其收到两个发往1.1.1.1的域外路由 方向分别为指向R2和指向R5,其cost值都为类型二,种子度量值为一,因为R5发来的1.1.1.1路由信息传递过程中的累加开销值小,所以R3路由器上前往1.1.1.1 的指向R5,路由环路出现。
实现