该局点客户希望在SR66路由器上对同一条路由,根据不同的下一跳做OSPF路由过滤,达到以下效果:
1、9.9.9.9/32。SR66学习从路由器A发布的这条OSPF路由,不学习从路由器B发布的这条OSPF路由。
2、10.10.10.0/24。SR66不学习这条路由。
3、11.11.11.11/32。SR66学习这条路由。
该局点的部分组网如上图所示。其中,路由器A发布了一条OSPF路由9.9.9.9/32,路由器B发布了一条OSPF路由9.9.9.9/32以及两条OSPF外部路由10.10.10.0/24、11.11.11.11/32 。
SR66未进行路由过滤时,路由表如下所示:
Routing Tables: Public
Destinations : 10 Routes : 11
Destination/Mask Proto Pre Cost NextHop Interface
9.9.9.9/32 OSPF 10 1 10.0.0.2 GE0/0/1
OSPF 10 1 11.0.0.2 GE0/0/3
10.0.0.0/24 Direct 0 0 10.0.0.1 GE0/0/1
10.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
10.10.10.0/24 O_ASE 150 1 11.0.0.2 GE0/0/3
11.0.0.0/24 Direct 0 0 11.0.0.1 GE0/0/3
11.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
11.11.11.11/32 O_ASE 150 1 11.0.0.2 GE0/0/3
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
172.16.1.1/32 Direct 0 0 127.0.0.1 InLoop0
我们发现,客户的需求可以归纳为以下两点:
1、 在SR66上过滤掉下一跳为11.0.0.2、具体条目为9.9.9.9/32和10.10.10.0/24的两条路由。
2、 放通其它所有的OSPF路由。
明确了客户的需求后,我们即可在SR66上使用地址前缀列表、路由策略等功能,实现客户需求。
解决方法:
首先配置地址前缀列表:
#
ip ip-prefix 2 index 10 permit 9.9.9.9 32 //匹配9.9.9.9/32这条路由
ip ip-prefix 2 index 11 permit 10.10.10.0 24 //匹配10.10.10.0/24这条路由
ip ip-prefix 3 index 10 permit 11.0.0.2 32 //匹配下一跳为11.0.0.2
#
然后,配置路由策略。路由策略同一节点中不同if-match子句的过滤关系为“与”的关系,即必须满足该节点的所有if-match子句;路由策略节点之间的过滤关系是“或”的关系,即通过一个节点的过滤就意味着通过该路由策略的过滤。
#
route-policy h3c deny node 10
if-match ip-prefix 2
if-match ip next-hop ip-prefix 3
route-policy h3c permit node 20 //空节点,放通所有路由
#
最后,在OSPF进程下配置路由过滤:
#
ospf 1
filter-policy route-policy h3c import
area 0.0.0.0
network 10.0.0.0 0.0.0.255
area 0.0.0.1
network 11.0.0.0 0.0.0.255
#
此时,查看SR66的路由表:
[SR66]display ip routing-table
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost NextHop Interface
9.9.9.9/32 OSPF 10 1 10.0.0.2 GE0/0/1
10.0.0.0/24 Direct 0 0 10.0.0.1 GE0/0/1
10.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
11.0.0.0/24 Direct 0 0 11.0.0.1 GE0/0/3
11.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
11.11.11.11/32 O_ASE 150 1 11.0.0.2 GE0/0/3
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
172.16.1.1/32 Direct 0 0 127.0.0.1 InLoop0
可见,客户需求得到满足。
需要注意的是,该方法只能过滤路由,无法过滤OSPF的LSA,所以,只在SR66本地生效。如需过滤LSA,请参考SR66配置手册,使用其它方法。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作