一、场景需求
R3访问R1的1.1.1.1 实现路由负载
R3访问11.11.11.2通过R3访问
R3访问11.11.11.1通过R2访问
二、拓扑
三、 配置步骤
1、基本的RIP和OSPF关键配置
R1关键配置:
<R1>display current-configuration configuration rip
rip 1
version 2
network 10.0.0.0
network 11.0.0.0
network 1.0.0.0
R2关键配置:
[R2]display current-configuration configuration rip
rip 1
version 2
network 10.0.0.0
[R2]display current-configuration configuration ospf
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 10.1.23.2 0.0.0.0
R3关键配置:
<R3>display current-configuration configuration ospf
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 10.1.23.3 0.0.0.0
network 10.1.34.3 0.0.0.0
R4关键配置:
[R4]display current-configuration configuration ri
rip 1
version 2
network 10.0.0.0
[R4]display current-configuration configuration ospf
ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 10.1.34.4 0.0.0.0
2、通过Route-policy+ACL+Cost实现路由精准访问
R2配置ACL+RP+Cost+路由引入调用RP
acl number 2001
rule 5 permit source 11.11.11.1 0
acl number 2002
rule 5 permit source 11.11.11.2 0
route-policy HCIE permit node 10
if-match acl 2001
apply cost 50
route-policy HCIE permit node 20
if-match acl 2002
apply cost 10 //配置匹配访问11.2的cost 10 优于11.1的50
route-policy HCIE permit node 30
R4配置ACL+RP+Cost+路由引入调用RP
acl number 2001
rule 5 permit source 11.11.11.1 0
acl number 2002
rule 5 permit source 11.11.11.2 0
route-policy HCIE permit node 10
if-match acl 2001
apply cost 10 //配置匹配访问11.1的cost 10 优于11.2的50
route-policy HCIE permit node 20
if-match acl 2002
apply cost 50
route-policy HCIE permit node 30
四、配置验证
通过R3查看OSPF路由,对于1.1.1.1的路由实现负载,11.1的路由走R4,11.2的路由走R2
如果喜欢这段内容,欢迎大家关注头条号,点赞、收藏、分享、转发。
资料每天限量10份先来先得哦,单独私信小编免费领取哦!【私信小编备注:资料】欢迎来撩。
欢迎关注转发学网络小伙伴们,关注分享该WX Gongzhonghao,持续分享干货网络技术,定期公开技术答疑!
同时为方便广大网络爱好者一起共同学习交流,开设了华为&思科网络技术交流qun,qun里上传大量免费学习资料,欢迎广大网络爱好者进群学习交流!【每天限量10份额,先来先得额】