前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >路由|BGP中的联邦

路由|BGP中的联邦

作者头像
刘銮奕
发布2019-07-22 17:16:12
1.2K0
发布2019-07-22 17:16:12
举报
文章被收录于专栏:奕知伴解奕知伴解

联邦把将大AS划分成若干个小AS,小AS之间是EBGP关系。在一定程度上解决了BGP水平分割路由不能互相传递的问题。 在配置联邦的时候需要特别注意几点:

1、联邦中的所有路由器都必须用起小AS号。(Route bgp 小AS) 2、联邦中的所有路由器都必须声明大AS号 3、连接小AS的边界路由器要互相指peers

两个小AS之间也要解决多跳问题,大AS的边界路由器必须向内做next-hop-self。

下面就通过实验来更加清晰的了解吧!

拓扑图解释:R1,R2,R3之间通过环回口使用EIGRP建立邻居,R1和R2之间是IBGP的关系,两个小AS之间是EBGP的关系;各个路由之间的网段详见拓扑图;R4和R5使用环回口模拟内网。 最终目的:在使用的联邦的条件下,使172.16.1.1可以ping成功192.168.16.1

============

代码语言:javascript
复制
R1:R1(config)#int s1/0
R1(config-if)#ip add 12.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#
R1(config)#int s1/1
R1(config-if)#ip add 13.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#
R1(config)#router eigrp 90
R1(config-router)#no auto-summary
R1(config-router)#network 12.1.1.1 0.0.0.0
R1(config-router)#network 1.1.1.1 0.0.0.0
R1(config-router)#network 13.1.1.1 0.0.0.0//联邦中的所有路由器都必须用起小AS号。
R1(config)#router bgp 64512R1(config-router)#bgp router-id 1.1.1.1//联邦中的所有路由器都必须声明大AS号
R1(config-router)#bgp confederation identifier 123//指定邻居
R1(config-router)#neighbor 2.2.2.2 remote-as 64512//对环回口进行源更新
R1(config-router)#neighbor 2.2.2.2 update-source lo0R1(config-router)#neighbor 3.3.3.3 remote-as 64513
R1(config-router)#//对环回口进行源更新
R1(config-router)#neighbor 3.3.3.3 update-source lo0
R1(config-router)#//R1和R3之间是EBGP,要设置多跳
R1(config-router)#neighbor 3.3.3.3 ebgp-multihop//连接小AS的边界路由器要互相指peers
R1(config-router)#bgp confederation peers 64513

============

代码语言:javascript
复制
R2:R2(config)#int s1/0
R2(config-if)#ip add 12.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#ex
R2(config)#
R2(config)#router eigrp 90
R2(config-router)#no auto-summary
R2(config-router)#network 12.1.1.2 0.0.0.0
R2(config-router)#network 2.2.2.2 0.0.0.0
R2(config-router)#
R2(config)#router bgp 64512R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#bgp confederation identifier 123R2(config-router)#neighbor 1.1.1.1 remote-as 64512R2(config-router)#neighbor 1.1.1.1 update-source lo0//指定下一跳为自身
R2(config-router)#neighbor 1.1.1.1 next-hop-self
R2(config-router)#
R2(config-router)#neighbor 24.1.1.4 remote-as 4

============

代码语言:javascript
复制
R3:R3(config)#int s1/1
R3(config-if)#ip add 13.1.1.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#ex
R3(config)#
R3(config)#router eigrp 90
R3(config-router)#no auto-summary
R3(config-router)#network 13.1.1.3 0.0.0.0
R3(config-router)#network 3.3.3.3 0.0.0.0R3(config)#router bgp 64513
R3(config-router)#bgp router-id 3.3.3.3
R3(config-router)#bgp confederation identifier 123
R3(config-router)#
R3(config-router)#neighbor 1.1.1.1 remote-as 64512
R3(config-router)#
R3(config-router)#neighbor 1.1.1.1 update-source lo0
R3(config-router)#
R3(config-router)#neighbor 1.1.1.1 ebgp-multihopR3(config-router)#bgp confederation peers 64512R3(config)#int s1/0
R3(config-if)#ip add 35.1.1.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#ex
R3(config)#router bgp 64513
R3(config-router)#neighbor 35.1.1.5 remote-as 5
R3(config-router)#neighbor 1.1.1.1 next-hop-self

============

代码语言:javascript
复制
R3#show ip route     1.0.0.0/24 is subnetted, 1 subnets
D        1.1.1.0 [90/2297856] via 13.1.1.1, 00:00:17, Serial1/1
     2.0.0.0/24 is subnetted, 1 subnets
D        2.2.2.0 [90/2809856] via 13.1.1.1, 00:00:17, Serial1/1
     3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        3.3.3.0/24 is directly connected, Loopback0
L        3.3.3.3/32 is directly connected, Loopback0
     12.0.0.0/24 is subnetted, 1 subnets
D        12.1.1.0 [90/2681856] via 13.1.1.1, 00:00:17, Serial1/1
     13.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        13.1.1.0/24 is directly connected, Serial1/1
L        13.1.1.3/32 is directly connected, Serial1/1

在R3上查看路由表,此时说明EIGRP配置成功!

============

代码语言:javascript
复制
R4R4(config)#int s1/1
R4(config-if)#ip add 24.1.1.4 255.255.255.0
R4(config-if)#no sh
R4(config-if)#ex
R4(config)#
R4(config)#int lo0
R4(config-if)#ip add 172.16.1.1 255.255.255.0R4(config)#router bgp 4
R4(config-router)#bgp router-id 4.4.4.4
R4(config-router)#neighbor 24.1.1.2 remote-as 123//进行路由宣告
R4(config-router)#network 172.16.1.0 mask 255.255.255.0

============

代码语言:javascript
复制
R5R5(config)#int s1/0
R5(config-if)#ip add 35.1.1.5 255.255.255.0
R5(config-if)#no sh
R5(config-if)#ex
R5(config)#
R5(config)#int lo0
R5(config-if)#ip add 192.168.1.1 255.255.255.0
R5(config-if)#
R5(config-if)#no sh
R5(config-if)#
R5(config)#router bgp 5
R5(config-router)#bgp router-id 5.5.5.5R5(config-router)#neighbor 35.1.1.3 remote-as 123
R5(config-router)#
R5(config-router)#network 192.168.1.0 mask 255.255.255.0
R5(config-router)#

============

在实验中可能会遇到的一些问题及应该出现的现象

在R2和R3上需要对R1进行配置next-hop-self,下一跳为自身,否则不能实现路由互联。

在配置联邦时,连接小AS的边界路由器要互相指peers:  router bgp 64512 bgp confederation peers 64513

如果不配置会默认指向大的AS号:123,因此会报连接了错误的AS号。

上面的现象,是在R2和R3上面都配置了next-hop-self,才会出现172.16.1.0和192.168.16.0的网段路由

此时只配置了R2的next-hop-self

出现这样的情况,是没有小AS之间没有互指peers

出现这样的现象,代表全部配置成功!

============

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2018-03-28,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 奕知伴解 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档