题目
修改配置使这个重发布选路最优
网络IP配置
具体配置命令暂不演示
解决方法
RIP(R1)
方法1(前缀列表):修改实际开销值大一点的路径的开销
修改从r2进来和出去时34.0.0.0的优先级
[r2]ip ip-prefix bbb permit 34.0.0.0 24
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]rip metricout ip-prefix bbb 2
[r2-GigabitEthernet0/0/0]rip metricin ip-prefix bbb 2
[r2-GigabitEthernet0/0/0]q
修改从r3进来和出去时24.0.0.0的优先级
[r3]ip ip-prefix bbb permit 24.0.0.0 24
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]rip metricout ip-prefix bbb 2
[r3-GigabitEthernet0/0/0]rip metricin ip-prefix bbb 2
[r3-GigabitEthernet0/0/0]
方法2(过滤列表):用过滤列表拒绝从g0/0/0接口进来的34.0.0.0
[r1]ip ip-prefix aa permit 0.0.0.0 0 less-equal 32
[r1]ip ip-prefix ab deny 34.0.0.0 24
[r1]rip
[r1-rip-1]filter-policy ip-prefix ab import GigabitEthernet 0/0/0
[r1-rip-1]filter-policy ip-prefix aa import GigabitEthernet 0/0/0
[r1-rip-1]q
测试结果
OSPF(R4)
这里使用路由策略+acl
在R2上配置,在这条链路上拒绝rip发来的13.0.0.0和R3的环回,放行其他所有路由
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 13.0.0.0 0.0.0.255
[r2-acl-basic-2000]q
[r2]acl 2001
[r2-acl-basic-2001]rule permit source 3.3.3.0 0.0.0.255
[r2-acl-basic-2001]q
[r2]route-policy aa deny node 10
Info: New Sequence of this List.
[r2-route-policy]if-match acl 2000
[r2-route-policy]q
[r2]route-policy aa deny node 15
Info: New Sequence of this List.
[r2-route-policy]if-match acl 2001
[r2-route-policy]q
[r2]route-policy aa permit node 20
Info: New Sequence of this List.
[r2-route-policy]q
[r2]display route-policy aa
Route-policy : aa
deny : 10 (matched counts: 3)
Match clauses :
if-match acl 2000
deny : 15 (matched counts: 5)
Match clauses :
if-match acl 2001
permit : 20 (matched counts: 7)
[r2]
[r2]ospf 1
[r2-ospf-1]import-route rip route-policy aa
[r2-ospf-1]
在R3上配置,在这条链路上拒绝rip发来的12.0.0.0和R2的环回,放行其他所有路由
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 12.0.0.0 0.0.0.255
[r3-acl-basic-2000]q
[r3]acl 2001
[r3-acl-basic-2001]rule permit source 2.2.2.0 0.0.0.255
[r3-acl-basic-2001]q
[r3]route-policy aa deny node 10
Info: New Sequence of this List.
[r3-route-policy]if-match acl 2000
[r3-route-policy]q
[r3]route-policy aa deny node 15
Info: New Sequence of this List.
[r3-route-policy]if-match acl 2001
[r3-route-policy]q
[r3]route-policy aa permit node 20
Info: New Sequence of this List.
[r3-route-policy]q
[r3]display route-policy aa
Route-policy : aa
deny : 10 (matched counts: 0)
Match clauses :
if-match acl 2000
deny : 15 (matched counts: 0)
Match clauses :
if-match acl 2001
permit : 20 (matched counts: 0)
[r3]
[r3]ospf 1
[r3-ospf-1]import-route rip route-policy aa
[r3-ospf-1]
测试结果