路由协议&OSPF中双点双向重发布解决路由引入问题(华为)

描述

 

OSPF

OSPF
OSPF
1.配置地址

2.启动ospf协议

3.启动rip协议

4.将PC1 的路由引入OSPF中

[R1]ospf 1

[R1-ospf-1]import-route direct
OSPF

5.将 PC2重发布到RIP中

[R4]rip

[R4-rip-1]import-route direct

OSPF

6.在R2 和R3上进行双点双向重发布

[R3]rip
[R3-rip-1]import-route ospf 1
[R3]ospf 1
[R3-ospf-1]import-route rip u

[R2]rip
[R2-rip-1]import-route ospf 1
[R2]ospf 1
[R2-ospf-1]import-route rip

R1路由表

OSPF

7.在R3的路由表中 存在一个次优路由

OSPF

(1)第一种解决办法

[R2]ip ip-prefix pc1 permit 10.1.1.0 24
[R2]route-policy pc1 permit node 10
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix pc1
[R2-route-policy]apply preference 90
[R2-route-policy]qu
[R2]route-policy pc1 permit node 20
Info: New Sequence of this List.
[R2]ospf 1
[R2-ospf-1]preference route-policy pc1
[R2-ospf-1]qu

[R3]ip ip-prefix pc1 permit 10.1.1.0 24
[R3]route-policy pc1 permit node 10
Info: New Sequence of this List.
[R3-route-policy]if-match ip-prefix pc1
[R3-route-policy]apply preference 160
[R3-route-policy]qu
[R3]route-policy pc1 permit node 20
Info: New Sequence of this List.
[R3-route-policy]qu

[R3]rip 1
[R3-rip-1]preference route-policy pc1

反应较慢 可以通过shutdown 接口来查看

R2上配置是为了以后R2故障后出现该次优路由

OSPF

第二种方法:

[R3]ip ip-prefix xwl deny 10.1.1.0 24
[R3]ip ip-prefix xwl permit 0.0.0.0 0 less-equal 32
[R3-rip-1]filter-policy ip-prefix xwl import GigabitEthernet 0/0/1 学习到该次优路由的接口

OSPF

第三种方法:
[R1]ospf 1
[R1-ospf-1]
[R1-ospf-1]import-route direct ?

cost Set cost
route-policy Route policy
tag Specify route tag
type Metric type of the imported external routes
Please press ENTER to execute command
[R1-ospf-1]import-route direct tag 111
OSPF

OSPF

然后在R2 和R3上根据需求采取第一或第二种办法

[R3]route-policy tag permit node 10
Info: New Sequence of this List.
[R3-route-policy]if-match tag 111
[R3-route-policy]apply preference 90
[R3-route-policy]qu
[R3]route-policy pc1 permit node 20
Info: New Sequence of this List.
[R3-route-policy]qu

[R2]ospf 1
[R2-ospf-1]preference route-policy tag
[R2-ospf-1]qu
OSPF

 

 

打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分