一、思路 ;
1.增加不优选路开销解决选路不佳问题
2.用增加开销的方式使R1 不将ASBR传的R7传给另一台ASBR解决R1、R2、R3、R4pingR7环回环路
二、操作
------IP地址配置如图
1.解决环路
[r2] ip ip-prefix a permit 7.7.7.0 24
[r2]route-policy huawei permit node 10
[r2-route-policy]if-match ip-prefix a
[r2-route-policy]apply cost 14
[r2-route-policy]q
[r3] ip ip-prefix a permit 7.7.7.0 24
[r3]route-policy huawei permit node 10
[r3-route-policy]if-match ip-prefix a
[r3-route-policy]apply cost 14
[r3-route-policy]q
[r2]ospf 1
[r2-ospf-1]import-route rip 1 route-policy hua
[r3]ospf 1
[r3-ospf-1]import-route rip 1 route-policy hua
2.解决选路不佳
R1
[r1]ip ip-prefix aa permit 24.1.1.0 24
[r1]ip ip-prefix bb permit 34.1.1.0 24
[r1]ip ip-prefix bb permit 3.3.3.3 32
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]rip metricin ip-prefix aa 2
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]rip metricin ip-prefix bb 2
[r1-GigabitEthernet0/0/1]
R4
[r3] ip ip-prefix b permit 12.1.1.0 24
[r3] ip ip-prefix b permit 2.2.2.024
[r2] ip ip-prefix b permit 13.1.1.0 24
[r2]route-policy hua permit node 10
[r2-route-policy]if-match ip-prefix b
[r2-route-policy]apply cost 7
[r2-route-policy]q
[r2]route-policy huawei permit node 30
[r3]route-policy huawei permit node 30
[r3]route-policy hua permit node 10
[r3-route-policy]if-match ip-prefix b
[r3-route-policy]apply cost 7
[r3-route-policy]q
[r3]route-policy huawei permit node 30
[r2]rip 1
[r2-rip-1]import-route ospf 1 route-policy huawei
[r3]rip 1
[r3-rip-1]import-route ospf 1 route-policy huawei
三、检验查看R1、R4路由表