1.要求:选路最佳
2.IP配置
r1
r2
r3
r4
3.选路最佳
r1路由表3.3.3.0 4.4.4.0 2.4.1.1.0 34.1.1.1.0均负载均恒
定义要抓取的流量
ip ip-prefix 4 index 10 permit 3.3.3.0 24
ip ip-prefix 4 index 20 permit 34.1.1.0 24
ip ip-prefix 3 index 10 permit 24.1.1.0 24
应用到接口
interface GigabitEthernet0/0/0
rip metricin ip-prefix 4 2
interface GigabitEthernet0/0/1
rip metricin ip-prefix 3 2
调用后r1路由表
r4路由表配置前
r2上
定义要抓取的流量
ip ip-prefix gg index 10 permit 2.2.2.0 24
ip ip-prefix gg index 20 permit 12.1.1.0 24
设置策略
route-policy gg permit node 10
if-match ip-prefix gg
apply cost-type type-1
route-policy gg permit node 20
if-match ip-prefix gg
apply cost-type type-1
route-policy gg permit node 50
应用策略
import-route rip 1 route-policy gg
r3上
#定义要抓取的流量
[r4]ip ip-prefix gg permit 14.1.1.0 24
设置策略
[r4]route-policy gg permit node 10
Info: New Sequence of this List.
[r4-route-policy]if-match ip-prefix gg
[r4-route-policy]apply cost-type type-1
[r4-route-policy]q
[r4]route-policy gg permit node 50
Info: New Sequence of this List.
[r4-route-policy]q
应用策略
[r4]ospf
[r4-ospf-1]import-route rip route-policy gg
配置完成后r4的路由表