hcip路由策略

拓扑图

 R1、R2、R3运行ospf

R1引入直连

10.0.14.0 24

10.0.15.0 24

10.0.16.0 24

要求R2、R3只能学习到10.0.14.0的路由,在R1做路由发布的过滤:

基本配置:

sys
sys R1
int g0/0/0
ip add 10.0.12.1 24
ospf 1 router-id 1.1.1.1 
a 0
net 10.0.12.1 0.0.0.0
int loopback 1
ip add 1.1.1.1 32
int loopback 2
ip add 2.2.2.2 32
int loopback 3
ip add 3.3.3.3 32
int g0/0/1
ip add 10.0.14.1 24
int g0/0/2
ip add 10.0.15.1 24
int g0/0/3
ip add 10.0.16.1 24
sys
sys R2
int g0/0/0
ip add 10.0.12.2 24
int g0/0/1
ip add 10.0.23.2 24
ospf 1 router-id 2.2.2.2 
a 0
net 10.0.12.2 0.0.0.0
net 10.0.23.2 0.0.0.0 
sys
sys R3
int g0/0/1
ip add 10.0.23.3 24

ospf 1 router-id 3.3.3.3
a 0
net 10.0.23.3 0.0.0.0

在R1上编写匹配项ip-prefix

ip ip-prefix out index 10 permit 10.0.14.0 24

在OSPF进程中调用filter-policy选择出方向

ospf 1
filter-policy ip-prefix out export

在OSPF进程中导入直连

ospf 1
import-route direct

在R2上查看效果

dis ip routing-table

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值