使用Route-Map过滤BGP的路由

本文通过实验介绍了如何使用Route-Map来过滤BGP的路由。实验目标是掌握Route-Map的配置,实验拓扑涉及多个路由器节点。在R2上配置了Route-Map后,观察R3的路由表以验证过滤效果。
摘要由CSDN通过智能技术生成

实验目的

1、掌握使用Route-Map过滤BGP的路由。

实验拓扑

接口ip配置与bgp基础配置详见:

CSDNicon-default.png?t=N7T8https://mp.csdn.net/mp_blog/creation/editor/125210020查看R3的路由表:

R3#show ip route   

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 4 subnets
B       1.1.0.0 [20/0] via 23.23.23.2, 00:00:01
B       1.1.1.0 [20/0] via 23.23.23.2, 00:00:01
B       1.1.2.0 [20/0] via 23.23.23.2, 00:04:53
B       1.1.3.0 [20/0] via 23.23.23.2, 00:04:53
     23.0.0.0/24 is subnetted, 1 subnets
C       23.23.23.0 is directly connected, FastEthernet0/1
     12.0.0.0/24 is subnetted, 1 subnets
B       12.12.12.0 [20/0] via 23.23.23.2, 00:04:53

在R2上配置Route-map路由过滤:

R2(config)#access-list 1 deny 1.1.0.0 0.0.0.255
R2(config)#access-list 1 deny 1.1.1.0 0.0.0.255
R2(config)#access-list 1 permit any 

R2(config)#route-map bgpfilter permit 10
R2(config-route-map)#match ip address 1
R2(config)#router bgp 12
R2(config-router)#neighbor 23.23.23.3 route-map bgpfilter out 

查看R3的路由表,确认路由过滤的配置:

R3#show ip route   

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 2 subnets
B       1.1.2.0 [20/0] via 23.23.23.2, 00:07:33
B       1.1.3.0 [20/0] via 23.23.23.2, 00:07:33
     23.0.0.0/24 is subnetted, 1 subnets
C       23.23.23.0 is directly connected, FastEthernet0/1
     12.0.0.0/24 is subnetted, 1 subnets
B       12.12.12.0 [20/0] via 23.23.23.2, 00:07:33

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值