目录
1.拓扑图
2.要求
3.主要配置
4.测试
1.拓扑图
2.要求
达到所有目标最优,互有备份
3.主要配置
左边区域配置rip,右边区域配置ospf,以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,r3
[r2]rip
[r2-rip-1]import-route ospf 1[r2]ospf 1
[r2-ospf-1]import-route rip
[r3]rip
[r3-rip-1]import-route ospf 1[r3]ospf 1
[r3-ospf-1]import-route rip
设置最优路径,路由策略,更改下方(上方)路径开销值,使到达目的地址路径最优
这里以r1访问r2的还回(2.2.2.2)以及24.1.1.0网段为例
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 2.2.2.2 0.0.0.0 //抓取流量
[r1-acl-basic-2000]q[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]rip metricin 2000 ?
INTEGER<1-15> The value of metric adding to route
[r1-GigabitEthernet0/0/1]rip metricin 2000 2 //开销值+2
[r1-GigabitEthernet0/0/1]q
也可以使用重发布解决,使其在重发布的时候更改开销值
在r2上做重发布时更改开销值,让r1访问r3的还回(2.2.2.2)以及44.1.1.0网段选择其最优(下方)路径
[r2]ip ip-prefix xx permit 3.3.3.3 32
[r2]ip ip-prefix xx permit 34.1.1.0 24[r2]route-policy yy permit node 10
[r2-route-policy]if-match ip-prefix xx
[r2-route-policy]apply cost 3
[r2-route-policy]q
[r2]route-policy yy permit node 20 //做空表
做重发布时调用
[r2]rip 1
[r2-rip-1]import-route ospf 1 route-policy yy
再去更改r4访问r3以及12.1.1.0 13.1.1.0网段的最优路径
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 3.3.3.3 0.0.0.0[r2-acl-basic-2000]q
[r2]route-policy oo permit node 10
[r2-route-policy]if-match acl 2000
[r2-route-policy]apply cost 5
[r2-route-policy]q
[r2]route-policy oo permit node 20[r2-route-policy]q
调用
[r2]ospf 1
[r2-ospf-1]import-route rip route-policy ooacl抓取13.1.1.0
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 13.1.1.0 0.0.0.255
让r3 不重发布,从而达到r4去12.1.1.0网段选上方最优路径
[r3]ip ip-prefix xx permit 12.1.1.0 24
[r3]route-policy nn deny node 10
[r3-route-policy]if-match ip-prefix xx
[r3-route-policy]q
[r3]route-policy nn permit node 20
[r3-route-policy]q
[r3]ospf 1
[r3-ospf-1]import-route rip route-policy nn
[r3-ospf-1]q