拓扑图
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