欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 财经 > 金融 > BGP配置华为——路由汇总

BGP配置华为——路由汇总

2025/2/20 20:40:52 来源:https://blog.csdn.net/VVVVWeiYee/article/details/145594570  浏览:    关键词:BGP配置华为——路由汇总

实验拓扑

实验要求

1.R1,R2,R3间运行BGP,搭建EBGP邻居

2.R3一段的网络实现自动聚合,R1一端的网络实现手动路由聚合

3.启用as-set防环

实验配置

配置相关IP

过程省略,结果如图

R1

R2

R3

配置EBGP

[R1]bgp 100

[R1-bgp]router 10.10.1.1

[R1-bgp]peer 10.0.12.2 as 200

[R2]bgp 200

[R2-bgp]router 10.10.2.2

[R2-bgp]peer 10.0.12.1 as 100

[R2-bgp]peer 10.0.23.3 as 300

[R3-bgp]router 10.10.3.3

[R3-bgp]peer 10.0.23.2 as 200

在R2上查看BGP邻居,可以发现邻居建立完毕

自动汇总

创建前缀列表将相关网段接入,并使用路由策略调用前缀列表,最后将前缀列表包含的网段引入BGP当中,同时开启BGP上自动汇总功能,完成路由条目的自动汇总

[R3]ip ip-prefix 1 permit 172.17.0.0 16 greater-equal 24 less-equal 24

[R3]route-policy bgp permit node 10

Info: New Sequence of this List.

[R3-route-policy]if-match ip-prefix 1

[R3-route-policy]bgp 300

[R3-bgp]import-route direct route-policy bgp

[R3-bgp]summary automatic

Info: Automatic summarization is valid only for the routes imported through the

import-route command

.查看下bgp路由表,可以看见明细路由被抑制,路由汇总完成

查看汇总的路由,可以发现其出现了Aggregator和Aggregator ID

在R2上也可以看到传播的确实是聚合后的路由,

手动汇总

先将路由相关路由引入设备,再通过R2进行汇总,抑制明细路由

[R1]ip ip-prefix 1 permit 192.168.0.0 22 greater-equal 24 less-equal 24

[R1]route-policy bgp permit node 10

Info: New Sequence of this List.

[R1-route-policy]if-match ip-prefix 1

[R1]bgp 100

[R1-bgp]import-route direct route-policy bgp

[R2]bgp 200

[R2-bgp]aggregate 192.168.0.0 22 detail-suppressed

在R2上查看,明细路由是被抑制的

开启AS -set将进行防环

[R2-bgp]aggregate 192.168.0.0 22 detail-suppressed as-set

实验效果

未开启AS-set,看不到完整路径,有环路风险

开启AS-set之后,在R3上查看路由表,可以看到路由的详细路径信息

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词