双点双向重分布的问题
上图所示的网络中左边为OSPF协议,右边为IS-IS协议。R3与R4是两边的ASBR,这种情况下存在几个问题。
一 次优路径
当R1引入外部路由R7时,R3在OSPF区域学习到的优先级为150,引入IS-IS区域后变成了15,R4因为15的优先级更优,选择了R5作为去往R1的下一跳。
解决方案:在R3与R4上修改OSPF的外部优先级小于IS-IS的优先级15。
二 路由倒灌
如果R1引入的R7开销值大于1,从IS-IS区域引入回来的路由开销值是1,会造成R2选择开销更低的路由,造成环路。
三 虚假环路
在R6上引入的R8,如果R8路由DOWN掉后,由于已经通告到了OSPF区域,又会引入回IS-IS区域,因为R6上的R8路由已经DOWN掉,R5无法将报文发回到R6,会造成虚假环路。
解决方案:使用route-policy针对外部引入的路由在R3和R4上通过加tag的方式进行过滤,同时只允许向一个方向转发。
详细命令
R3配置
[R3]ip ip-prefix 1 index 10 permit 30.1.0.0 24
[R3]ip ip-prefix 2 index 10 permit 40.1.0.0 24
[R3]route-policy OI deny node 10
[R3-route-policy]if-match tag 100
[R3]route-policy OI permit node 20
[R3-route-policy]if-match ip-prefix 1
[R3-route-policy]apply tag 200
[R3]route-policy OI deny node 30
[R3-route-policy]if-match tag 500
[R3]route-policy OI permit node 40
[R3-route-policy]if-match ip-prefix 2
[R3-route-policy]apply tag 600
[R3]route-policy OI permit node 50
[R3]route-policy IO deny node 10
[R3-route-policy]if-match tag 300
[R3]route-policy IO permit node 20
[R3-route-policy]if-match ip-prefix 1
[R3-route-policy]apply tag 400
[R3]route-policy IO deny node 30
[R3-route-policy]if-match tag 700
[R3]route-policy IO permit node 40
[R3-route-policy]if-match ip-prefix 2
[R3-route-policy]apply tag 800
[R3]route-policy IO permit node 50
[R3-ospf-1]preference ase 14
[R3-ospf-1]import-route isis 1 type 1 route-policy OI
[R3-isis-1]import-route ospf 1 inherit-cost route-policy IO
R4配置
[R4]ip ip-prefix 1 index 10 permit 30.1.0.0 24
[R4]ip ip-prefix 2 index 10 permit 40.1.0.0 24
[R4]route-policy OI deny node 10
[R4-route-policy]if-match tag 400
[R4]route-policy OI permit node 20
[R4-route-policy]if-match ip-prefix 1
[R4-route-policy]apply tag 300
[R4]route-policy OI deny node 30
[R4-route-policy]if-match tag 800
[R4]route-policy OI permit node 40
[R4-route-policy]if-match ip-prefix 2
[R4-route-policy]apply tag 700
[R4]route-policy OI permit node 50
[R4]route-policy IO deny node 10
[R4-route-policy]if-match tag 200
[R4]route-policy IO permit node 20
[R4-route-policy]if-match ip-prefix 1
[R4-route-policy]apply tag 100
[R4]route-policy IO deny node 30
[R4-route-policy]if-match tag 600
[R4]route-policy IO permit node 40
[R4-route-policy]if-match ip-prefix 2
[R4-route-policy]apply tag 500
[R4]route-policy IO permit node 50
[R4-ospf-1]preference ase 14
[R4-ospf-1]import-route isis 1 type 1 route-policy OI
[R4-isis-1]import-route ospf 1 inherit-cost route-policy IO