BGP Confederation(BGP联盟)
BGP Confederation(BGP联盟)
转载地址:http://hi.baidu.com/networkor/item/652e2729f37d50e851fd8724
为了解决由于从iBGP邻居收到的路由不能转发给其它iBGP邻居的限制问题,除了可以使用在iBGP邻居之间创建全互联的邻居关系和使用BGP Reflector之外,还可以使用BGP Confederation(BGP联邦)。
因为只有从iBGP邻居收到的路由才不能转发给其它iBGP邻居,而从eBGP邻居收到的路由可以转发给任何邻居,包括iBGP邻居,所以在拥有多个路由器的大型AS中,BGP Confederation采用在AS内部建立多个子AS的方法,从而将一个大的AS分割成多个小型AS,让AS内部拥有足够数量的eBGP邻居关系来解决路由限制问题。
如下图
在上图中,当R3从iBGP邻居R1收到路由后,不能再转发给iBGP邻居R4,而R2从eBGP邻居R5收到R1的路由后,因为拥有自己的AS号码,最后将路由丢弃而不转发给R4,最终造成R4拥有不完整的路由表,同样R3也像R4一样不能拥有完整的路由表。
对于上述问题,可以创建全互联的BGP邻居关系,或者在R3和R4上配置BGP Reflector的方法来解决。除此之外,还可以使用在AS内部创建BGP Confederation的方法来解决,如下:
在上图环境中,通过BGP Confederation的方式在R1与R3之间创建子AS 64512,而在R2与R4之间创建子AS 64513,这样一来,在R1将全部路由发给R3,以及R2将全部路由发给R4之后,
因为R3与R4是eBGP邻居的关系,所以R3与R4之间可以任意转发BGP路由信息,从而使双方都拥有完整的全网路由表。
在使用BGP Confederation在AS内部创建子AS时,建议使用私有AS号码,范围是64512-65534,所有BGP Confederation内部的子AS,对于外界都是不可见的,如上图中,R1与R2在AS 1中分别为AS 64512和AS 64513,但是对于R5来说,R1和R2都为AS 1的,而AS 64512和AS 64513对于R5来说是透明的,外界并不知道AS内部是否创建了BGP Confederation,对于子AS的号码只在AS内部传递路由时才会添加到AS_Path中去,在出AS时,这些子AS号码是不会写入AS_Path的。
注:
★在路径属性中,联邦内部的子AS是不被AS_Path计算在内的。
★在选路规则中,比较eBGP与iBGP邻居类型时,AS内部的子AS之间是不作eBGP与iBGP邻居类型比较的。
配置BGP Confederation
说明:
上图中所有路由器都配有Loopback地址,地址分别为:
R1 Loopback 0 1.1.1.1/32 Loopback 11 11.1.1.1/24
R2 Loopback 0 2.2.2.2/32 Loopback 22 22.2.2.2/24
R3 Loopback 0 3.3.3.3/32 Loopback 33 33.3.3.3/24
R4 Loopback 0 4.4.4.4/32 Loopback 44 44.4.4.4/24
R5 Loopback 0 5.5.5.5/32 Loopback 55 55.5.5.5/24
所有路由器之间运行OSPF,并将Loopback 0的地址发布到OSPF中,保证全网Loopback 0之间是可以通信的。
1.IGP保证全网Loopback 0互通
(1)配置OSPF
说明:此步略,请参见之前配置。
(2)测试全网Loopback 0连通性
r5#ping 1.1.1.1 source loopback 0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 5.5.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/114/228 ms
r5#ping 2.2.2.2 source loopback 0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 5.5.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/84/128 ms
r5#
r5#
r5#ping 3.3.3.3 source loopback 0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 5.5.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/106/180 ms
r5#ping 4.4.4.4 source loopback 0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 5.5.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/124/224 ms
r5#
说明:全网Loopback 0连通性连通性正常。
2.配置BGP Confederation
(1)在R5上配置BGP
r5(config)#router bgp 5
r5(config-router)#bgp router-id 5.5.5.5
r5(config-router)#neighbor 1.1.1.1 remote-as 1
r5(config-router)#neighbor 1.1.1.1 update-source loopback 0
r5(config-router)#neighbor 1.1.1.1 ebgp-multihop
r5(config-router)#neighbor 2.2.2.2 remote-as 1
r5(config-router)#neighbor 2.2.2.2 update-source loopback 0
r5(config-router)#neighbor 2.2.2.2 ebgp-multihop
r5(config-router)#network 55.5.5.0 mask 255.255.255.0
说明:R5的配置常规不变。
(2)在R1上配置BGP Confederation
r1(config)#router bgp 64512
r1(config-router)#bgp router-id 1.1.1.1
r1(config-router)#bgp confederation identifier 1
r1(config-router)#bgp confederation peers 64513
r1(config-router)#neighbor 5.5.5.5 remote-as 5
r1(config-router)#neighbor 5.5.5.5 update-source loopback 0
r1(config-router)#neighbor 5.5.5.5 ebgp-multihop
r1(config-router)#neighbor 2.2.2.2 remote-as 64513
r1(config-router)#neighbor 2.2.2.2 update-source loopback 0
r1(config-router)#neighbor 2.2.2.2 ebgp-multihop
r1(config-router)#neighbor 3.3.3.3 remote-as 64512
r1(config-router)#neighbor 3.3.3.3 update-source loopback 0
r1(config-router)#network 11.1.1.0 mask 255.255.255.0
说明:指定子AS为64512,而真正的AS为1,并指明与AS 64513同属一个AS,在联邦内部与R2为eBGP关系,与R3为iBGP关系。
(3)在R2上配置BGP Confederation
r2(config)#router bgp 64513
r2(config-router)#bgp router-id 2.2.2.2
r2(config-router)#bgp confederation identifier 1
r2(config-router)#bgp confederation peers 64512
r2(config-router)#neighbor 5.5.5.5 remote-as 5
r2(config-router)#neighbor 5.5.5.5 update-source loopback 0
r2(config-router)#neighbor 5.5.5.5 ebgp-multihop
r2(config-router)#neighbor 1.1.1.1 remote-as 64512
r2(config-router)#neighbor 1.1.1.1 update-source loopback 0
r2(config-router)#neighbor 1.1.1.1 ebgp-multihop
r2(config-router)#neighbor 4.4.4.4 remote-as 64513
r2(config-router)#neighbor 4.4.4.4 update-source loopback 0
r2(config-router)#network 22.2.2.0 mask 255.255.255.0
说明:指定子AS为64513,而真正的AS为1,并指明与AS 64512同属一个AS,在联邦内部与R1为eBGP关系,与R4为iBGP关系。
(4)在R3上配置BGP Confederation
r3(config)#router bgp 64512
r3(config-router)#bgp router-id 3.3.3.3
r3(config-router)#bgp confederation identifier 1
r3(config-router)#bgp confederation peers 64513
r3(config-router)#neighbor 1.1.1.1 remote-as 64512
r3(config-router)#neighbor 1.1.1.1 update-source loopback 0
r3(config-router)#neighbor 4.4.4.4 remote-as 64513
r3(config-router)#neighbor 4.4.4.4 update-source loopback 0
r3(config-router)#neighbor 4.4.4.4 ebgp-multihop
r3(config-router)#network 33.3.3.0 mask 255.255.255.0
说明:指定子AS为64512,而真正的AS为1,并指明与AS 64513同属一个AS,在联邦内部与R4为eBGP关系,与R1为iBGP关系。
(5)在R4上配置BGP Confederation
r4(config)#router bgp 64513
r4(config-router)#bgp router-id 4.4.4.4
r4(config-router)#bgp confederation identifier 1
r4(config-router)#bgp confederation peers 64512
r4(config-router)#neighbor 2.2.2.2 remote-as 64513
r4(config-router)#neighbor 2.2.2.2 update-source loopback 0
r4(config-router)#neighbor 3.3.3.3 remote-as 64512
r4(config-router)#neighbor 3.3.3.3 update-source loopback 0
r4(config-router)#neighbor 3.3.3.3 ebgp-multihop
r4(config-router)#network 44.4.4.0 mask 255.255.255.0
说明:指定子AS为64513,而真正的AS为1,并指明与AS 64512同属一个AS,在联邦内部与R3为eBGP关系,与R1为iBGP关系。
3.查看BGP邻居关系
(1)查看R5的BGP邻居状况
r5#sh ip bgp summary
BGP router identifier 5.5.5.5, local AS number 5
BGP table version is 6, main routing table version 6
5 network entries using 645 bytes of memory
9 path entries using 468 bytes of memory
4/3 BGP path/bestpath attribute entries using 496 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1633 total bytes of memory
BGP activity 5/0 prefixes, 9/0 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 1 25 26 6 0 0 00:17:30 4
2.2.2.2 4 1 15 16 6 0 0 00:07:08 4
r5#
说明:R1与R2在联邦内部虽然为AS 64512和AS 64513,但对于R5来说,它们都为AS 1,子AS则透明不可见。
(2)查看R1的BGP邻居状况
r1#sh ip bgp summary
BGP router identifier 1.1.1.1, local AS number 64512
BGP table version is 6, main routing table version 6
5 network entries using 645 bytes of memory
6 path entries using 312 bytes of memory
6/4 BGP path/bestpath attribute entries using 744 bytes of memory
3 BGP AS-PATH entries using 72 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1773 total bytes of memory
BGP activity 5/0 prefixes, 6/0 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2.2.2.2 4 64513 13 13 6 0 0 00:06:27 3
3.3.3.3 4 64512 8 11 6 0 0 00:03:14 1
5.5.5.5 4 5 26 25 6 0 0 00:17:51 1
r1#
说明:子AS在联邦内部AS之间可见。
注:其它BGP邻居关系类同,不再一一查看。
4.查看BGP路由情况
(1)查看R5的BGP路由情况
r5#sh ip bgp
BGP table version is 6, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* 11.1.1.0/24 2.2.2.2 0 1 i
*> 1.1.1.1 0 0 1 i
* 22.2.2.0/24 1.1.1.1 0 1 i
*> 2.2.2.2 0 0 1 i
* 33.3.3.0/24 2.2.2.2 0 1 i
*> 1.1.1.1 0 1 i
* 44.4.4.0/24 1.1.1.1 0 1 i
*> 2.2.2.2 0 1 i
*> 55.5.5.0/24 0.0.0.0 0 32768 i
r5#
说明:R5已经收到全部的路由,说明对方AS内部正常稳定运行。
(2)查看R1的BGP路由情况
r1#sh ip bgp
BGP table version is 6, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 11.1.1.0/24 0.0.0.0 0 32768 i
*> 22.2.2.0/24 2.2.2.2 0 100 0 (64513) i
*>i33.3.3.0/24 3.3.3.3 0 100 0 i
*> 44.4.4.0/24 4.4.4.4 0 100 0 (64513) i
* 55.5.5.0/24 5.5.5.5 0 100 0 (64513) 5 i
*> 5.5.5.5 0 0 5 i
r1#
说明:R1也收到全部路由,说明BGP邻居正常运行,且路由收发和预期相同。需要注意,虽然在AS内部,R1与R2为eBGP邻居关系,但下一跳属性并没有作修改,所以需要手工修改。
(3)修改R2对R1的下一跳属性
r2(config)#router bgp 64513
r2(config-router)#neighbor 1.1.1.1 next-hop-self
(4)再次查看R1的BGP路由情况
r1#sh ip bgp
BGP table version is 7, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 11.1.1.0/24 0.0.0.0 0 32768 i
*> 22.2.2.0/24 2.2.2.2 0 100 0 (64513) i
*>i33.3.3.0/24 3.3.3.3 0 100 0 i
* i44.4.4.0/24 4.4.4.4 0 100 0 (64513) i
*> 2.2.2.2 0 100 0 (64513) i
* 55.5.5.0/24 2.2.2.2 0 100 0 (64513) 5 i
*> 5.5.5.5 0 0 5 i
r1#
说明:R2对R1的下一跳属性成功修改。
(5)AS内部都将改变下一跳属性
R1:
r1(config)#router bgp 64512
r1(config-router)#neighbor 2.2.2.2 next-hop-self
r1(config-router)#neighbor 3.3.3.3 next-hop-self
R3:
r3(config)#router bgp 64512
r3(config-router)#neighbor 1.1.1.1 next-hop-self
r3(config-router)#neighbor 4.4.4.4 next-hop-self
R4:
r4(config)#router bgp 64513
r4(config-router)#neighbor 2.2.2.2 next-hop-self
r4(config-router)#neighbor 3.3.3.3 next-hop-self
5.测试BGP联邦内部选路
(1)查看R1当前的BGP路由情况
r1#sh ip bgp
BGP table version is 7, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 11.1.1.0/24 0.0.0.0 0 32768 i
*> 22.2.2.0/24 2.2.2.2 0 100 0 (64513) i
*>i33.3.3.0/24 3.3.3.3 0 100 0 i
*> 44.4.4.0/24 2.2.2.2 0 100 0 (64513) i
* 55.5.5.0/24 2.2.2.2 0 100 0 (64513) 5 i
*> 5.5.5.5 0 0 5 i
r1#
说明:R1到达R5的网段55.5.5.0/24从S0/0出去。
(2)在R1上改变去往55.5.5.0/24的路径
说明:因为在路径比较中,联邦内部AS_Path是不被计算在内的,所以要证明虽然R1去往55.5.5.0/24,从R2走的AS_Path要长于R5,但并不是因为R2的AS_Path比R5长,因为子AS不被计算,所以只要选路规则的属性中AS_Path后面一个属性的变更影响到选路后,就能证明子AS是被忽略的,所以在此选择修改AS_Path后面的属性,如MED。
r1(config)#access-list 55 permit 55.5.5.0
r1(config)#route-map med permit 10
r1(config-route-map)#match ip address 55
r1(config-route-map)#set metric 55
r1(config-route-map)#exit
r1(config)#route-map med permit 20
r1(config-route-map)#exit
r1(config)#router bgp 64512
r1(config-router)#neighbor 5.5.5.5 route-map med in
说明:将走R5的MED值设置为55,大于R2的MED值0。
(3)再次查看R1去往55.5.5.0/24的路径
r1#sh ip bgp
BGP table version is 8, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 11.1.1.0/24 0.0.0.0 0 32768 i
*> 22.2.2.0/24 2.2.2.2 0 100 0 (64513) i
*>i33.3.3.0/24 3.3.3.3 0 100 0 i
*> 44.4.4.0/24 2.2.2.2 0 100 0 (64513) i
*> 55.5.5.0/24 2.2.2.2 0 100 0 (64513) 5 i
* 5.5.5.5 55 0 5 i
r1#
说明:R1去往55.5.5.0/24选择从R2走,虽然R1的AS_Path看起来比R5长,但因为联邦内部的子AS不被计算,所以最终因为R2的低MED值影响了选路,所以eBGP邻居优于iBGP邻居的规则在BGP联邦内部是被忽略的。
(4)查看R3的BGP路径
r3#sh ip bgp
BGP table version is 12, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i11.1.1.0/24 1.1.1.1 0 100 0 i
* 22.2.2.0/24 4.4.4.4 0 100 0 (64513) i
*>i 1.1.1.1 0 100 0 (64513) i
*> 33.3.3.0/24 0.0.0.0 0 32768 i
* 44.4.4.0/24 4.4.4.4 0 100 0 (64513) i
*>i 1.1.1.1 0 100 0 (64513) i
* 55.5.5.0/24 4.4.4.4 0 100 0 (64513) 5 i
*>i 1.1.1.1 0 100 0 (64513) 5 i
r3#
说明:可以看见,R3去往55.5.5.0/24,下一跳选择了iBGP邻居R1而没有选择eBGP邻居R4,所以再一次证实了eBGP邻居优于iBGP邻居的选路规则在BGP联邦内部是被忽略的。
BGP Confederation(BGP联盟)相关推荐
- BGP Confederation(BGP联邦)
BGP Confederation(BGP联邦) 为了解决由于从iBGP邻居收到的路由不能转发给其它iBGP邻居的限制问题,除了可以使用在iBGP邻居之间创建全互联的邻居关系和使用BGPReflect ...
- BGP—— Confederation联邦(讲解+配置)
目录 一.简介: 二.配置: --R1: --R3: 三.注意点: 一.简介: 为了解决BGP路由水平分割机制,从iBGP邻居收到的路由不能转发给其它iBGP邻居的限制问题,除了可以使用在iBGP邻居 ...
- BGP以及BGP对等体之间的交互原则
BGP--边界网关协议 BGP概述 边界网关协议:是一种实现自治系统AS之间的路由可达并选择最佳路由矢量性协议.早期发布的三个版本分别是BGP-1(RFC1105).BGP-2(RFC1163)和BG ...
- 大型企业及运营商国际出口使用的BGP技术,BGP基础配置
一.BGP基础 BGP属于边界网关协议,用于不同的AS之间,对于不同的运营商或企业可以使用不同的AS号,一般运营商配合MPLS常用的技术. 早些年是EGP属于外部网关协议,而EGP不能进行路由优选环路 ...
- 【计算机网络】网络层 : BGP 协议 ( BGP 协议简介 | BGP 协议信息交换 | BGP 协议报文格式 | BGP-4 常用报文 | RIP 、OSPF、BGP 协议对比 )
文章目录 一.路由选择协议分类 二.BGP 协议 简介 三.BGP 协议 信息交换过程 三.BGP 协议 报文格式 四.BGP 协议 特点 五.BGP-4 协议的 四种报文 六.RIP .OSPF.B ...
- 什么是BGP,BGP的优点有哪些?-Vecloud
什么是BGP? 边界网关协议(BGP)是运行于 TCP 上的一种自治系统(AS)的路由协议,是唯一能够妥善处理不相关路由域间的多路连接的协议. 通俗点讲 中国电信 .中国联通.中国移动和一些拥有AS自 ...
- 概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步
系列文件 BGP(Border Gatreway Protcol)边界网关路由协议 BGP基本配置 BGP实战拓扑 外部BGP基础配置 内部BGP邻居 EBGP基本配置 CCNP综合实验拓扑 文章目录 ...
- EBGP vs IBGP
在上一篇(BGP漫谈)介绍了BGP的一些基本概念.我们知道了BGP分为EBGP和IBGP.这次再进一步看看EBGP和IBGP有什么区别. 应用场景 从应用场景看,EBGP和IBGP的区别还是很明显的. ...
- 【博客465】BGP(边界网关协议)-----BGP路由黑洞及路由反射器与联盟
BGP(边界网关协议)-----BGP路由黑洞及路由反射器与联盟 路由黑洞的场景 黑洞出现场景: 两台非直连路由器可以建立BGP邻居关系,传递BGP路由.如果中间路由器没有运行BGP协议,可能会出现路 ...
最新文章
- activeform表单中的旧数据怎么显示_三分钟为你细数 Vue el-form 表单校验的坑点
- jbutton 数组创建 java_java-将JButton数组添加到JPanel(按钮不可见)
- (斜率,点和线段)zzuli1196数星星(二)
- 个性化推荐从入门到精通(附推荐产品经理修炼秘籍)
- C#中DllImport用法
- linux使用running网卡ping,Linux CentOS 7 IP地址配置及网络问题排查
- mysql的bht_BHT
- 狼人杀休闲游戏微信小程序模板源码/微信小游戏源码
- 测试方案包含哪些内容?
- im2col运算 - 一种卷积优化算法
- 解决gitlab内置node_exporter提供外部prometheus使用
- 【R语言实验】基于R语言的时间序列平稳性检验
- 菜鸟教程JVM优化,看一篇就够了!
- [翻译练习] Node interview of ElemeFE OS
- AM335x SPL(一)
- 红米android10参数,红米10x5g手机参数红米10x5g手机参数有哪些
- 3.JAVAEE-电子商城-用户管理模块
- 百度地图API进行网页地点展示
- 家庭用服务器的作用,家庭网络存储服务器四大主要功能
- 带宽、流量限制软件之Negies中文使用教程
热门文章
- 令克软件再推OpenAPI与MAS系统服务,强大引擎赋能券商多元化发展
- 计算机辅助cad3dmax,对Auto CAD3DMAXOpen GL在计算机辅助机械设计中应用分析.doc
- 积分第一中值定理与伏汝兰尼(Froullani)积分
- yaml 编码格式简述
- kindle长期未使用,界面显示电池感叹号
- 汽车“核战争”:Arm明年量产下一代架构,“全面计算”战略背后的隐忧
- 隧道安全管理八大系统
- java接口自动化测试-导入xslx模板进行批量检索
- T-SQL - 习题02_将数据表year|month|amount查询成year|m1|m2|m3|m4的样式
- 小程序数据框有重影_微信小程序input重影什么原因?怎么解决重影?