简介
本文档介绍在Nexus 9000系列上配置边界网关协议(BGP)联盟的过程。
先决条件
要求
Cisco 建议您了解以下主题:
使用的组件
本文档不限于特定的软件和硬件版本。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
背景信息
BGP用于避免路由环路的机制是在AS PATH属性中添加自己的自治系统编号(ASN)。对于IBGP拓扑,更新不会修改AS-PATH属性,因为它们属于同一ASN,这可能会导致路由环路。
BGP使用其水平分割规则,该规则表明BGP设备通过IBGP对等体接收前缀,并且无法将该前缀通告给另一个IBGP邻居。此规则强制您使用全网状拓扑与每个IBGP邻居交换前缀。对于使用全网状方案的大型网络,由于它使用过多资源来创建对等体,因此无法扩展。
iBGP的全网状拓扑的替代方案包括:
本文档仅重点介绍BGP联盟的用法。
BGP联盟通过将ASN划分为多个子自治系统并将它们分组为联盟消除了全网状拓扑的需要。
配置示例
要检查BGP联盟配置指南,请参阅高级BGP配置指南Nexus 9000。
网络图

注意:在拓扑中,Nexus 1、Nexus 2、Nexus 3和Nexus 4属于同一个联盟ASN 64513,将联盟划分为2个较小的ASN(64512和64514)
注意:Nexus 1和Nexus 3建立iBGP邻居关系。
注意:Nexus 2和Nexus 4建立iBGP邻居关系。
注意:Nexus 1和Nexus 2建立eBGP邻居关系。
配置
注意:联盟配置导致重置到每个已建立的bgp对等体。此配置必须在维护窗口下完成。
Nexus 1
Nexus1# show running-config bgp
!Command: show running-config bgp
!Running configuration last done at: Thu Jul 20 21:13:08 2023
!Time: Thu Jul 20 23:28:41 2023
version 10.2(5) Bios:version 05.47
feature bgp
router bgp 64512 --> Local ASN
confederation identifier 64513 --> BGP Confederation identifier
confederation peers 64514 --> ASN that belong to the Confederation
log-neighbor-changes
neighbor 10.0.5.2
remote-as 64515
address-family ipv4 unicast
neighbor 172.16.255.2
remote-as 64514
update-source loopback0
address-family ipv4 unicast
neighbor 172.16.255.3
remote-as 64512
log-neighbor-changes
update-source loopback0
address-family ipv4 unicast
Nexus 2
Nexus2# show running-config bgp
!Command: show running-config bgp
!Running configuration last done at: Thu Jul 20 21:12:54 2023
!Time: Thu Jul 20 23:31:04 2023
version 10.2(5) Bios:version 05.47
feature bgp
router bgp 64514 --> Local ASN
confederation identifier 64513 --> BGP Confederation identifier
confederation peers 64512 --> ASN that belong to the Confederation
log-neighbor-changes
neighbor 172.16.255.1
remote-as 64512
update-source loopback0
address-family ipv4 unicast
neighbor 172.16.255.4
remote-as 64514
update-source loopback0
address-family ipv4 unicast
Nexus 3
Nexus3# show running-config bgp
!Command: show running-config bgp
!Running configuration last done at: Thu Jul 20 21:14:54 2023
!Time: Thu Jul 20 23:31:45 2023
version 10.2(5) Bios:version 05.47
feature bgp
router bgp 64512 --> Local ASN
confederation identifier 64513 --> BGP Confederation identifier
log-neighbor-changes
neighbor 172.16.255.1
remote-as 64512
log-neighbor-changes
update-source loopback0
address-family ipv4 unicast
Nexus 4
Nexus4# show running-config bgp
!Command: show running-config bgp
!Running configuration last done at: Thu Jul 20 15:11:15 2023
!Time: Thu Jul 20 17:32:58 2023
version 10.2(5) Bios:version 05.47
feature bgp
router bgp 64514 --> Local ASN
confederation identifier 64513 --> BGP Confederation identifier
log-neighbor-changes
address-family ipv4 unicast
network 172.30.1.0/24
network 172.30.2.0/24
network 172.30.3.0/24
network 172.30.4.0/24
network 172.30.5.0/24
network 172.30.6.0/24
network 172.30.7.0/24
network 172.30.8.0/24
neighbor 172.16.255.2
remote-as 64514
update-source loopback0
address-family ipv4 unicast
Nexus 5
Nexus5# show running-config bgp
!Command: show running-config bgp
!Running configuration last done at: Thu Jul 20 21:13:32 2023
!Time: Thu Jul 20 23:33:34 2023
version 10.2(5) Bios:version 05.47
feature bgp
router bgp 64515 --> Local ASN
log-neighbor-changes
address-family ipv4 unicast
network 192.168.1.0/24
network 192.168.2.0/24
network 192.168.3.0/24
network 192.168.4.0/24
network 192.168.5.0/24
network 192.168.6.0/24
network 192.168.7.0/24
network 192.168.8.0/24
neighbor 10.0.5.1
remote-as 64513
address-family ipv4 unicast
验证
Nexus 1
步骤 1: 建立BGP邻居并交换前缀。
Nexus1# show ip bgp summary
BGP summary information for VRF default, address family IPv4 Unicast
BGP router identifier 172.16.255.1, local AS number 64512
BGP table version is 28, IPv4 Unicast config peers 3, capable peers 3
16 network entries and 16 paths using 4416 bytes of memory
BGP attribute entries [2/704], BGP AS path entries [2/12]
BGP community entries [0/0], BGP clusterlist entries [0/0]
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.0.5.2 4 64515 328 321 28 0 0 05:00:34 8
172.16.255.2 4 64514 270 264 28 0 0 04:16:51 8
172.16.255.3 4 64512 318 318 28 0 0 05:12:28 0
步骤 2:联盟对等体获取的前缀通过查看状态c-confed进行标识。
Nexus1# show ip bgp
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 28, Local Router ID is 172.16.255.1
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup, 2 - best2
Network Next Hop Metric LocPrf Weight Path
*>c172.30.1.0/24 172.16.255.4 100 0 (64514) i
*>c172.30.2.0/24 172.16.255.4 100 0 (64514) i
*>c172.30.3.0/24 172.16.255.4 100 0 (64514) i
*>c172.30.4.0/24 172.16.255.4 100 0 (64514) i
*>c172.30.5.0/24 172.16.255.4 100 0 (64514) i
*>c172.30.6.0/24 172.16.255.4 100 0 (64514) i
*>c172.30.7.0/24 172.16.255.4 100 0 (64514) i
*>c172.30.8.0/24 172.16.255.4 100 0 (64514) i
*>e192.168.1.0/24 10.0.5.2 0 64515 i
*>e192.168.2.0/24 10.0.5.2 0 64515 i
*>e192.168.3.0/24 10.0.5.2 0 64515 i
*>e192.168.4.0/24 10.0.5.2 0 64515 i
*>e192.168.5.0/24 10.0.5.2 0 64515 i
*>e192.168.6.0/24 10.0.5.2 0 64515 i
*>e192.168.7.0/24 10.0.5.2 0 64515 i
*>e192.168.8.0/24 10.0.5.2 0 64515 i
Nexus 2
步骤 1: 建立BGP邻居并交换前缀。
Nexus2# show ip bgp summary
BGP summary information for VRF default, address family IPv4 Unicast
BGP router identifier 172.16.255.2, local AS number 64514
BGP table version is 27, IPv4 Unicast config peers 2, capable peers 2
16 network entries and 16 paths using 3904 bytes of memory
BGP attribute entries [2/344], BGP AS path entries [1/12]
BGP community entries [0/0], BGP clusterlist entries [0/0]
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.16.255.1 4 64512 274 265 27 0 0 04:20:26 8
172.16.255.4 4 64514 269 262 27 0 0 04:16:00 8
步骤 2:联盟对等体获取的前缀通过查看状态c-confed进行标识。
Nexus2# show ip bgp
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 27, Local Router ID is 172.16.255.2
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup, 2 - best2
Network Next Hop Metric LocPrf Weight Path
*>i172.30.1.0/24 172.16.255.4 100 0 i
*>i172.30.2.0/24 172.16.255.4 100 0 i
*>i172.30.3.0/24 172.16.255.4 100 0 i
*>i172.30.4.0/24 172.16.255.4 100 0 i
*>i172.30.5.0/24 172.16.255.4 100 0 i
*>i172.30.6.0/24 172.16.255.4 100 0 i
*>i172.30.7.0/24 172.16.255.4 100 0 i
*>i172.30.8.0/24 172.16.255.4 100 0 i
*>c192.168.1.0/24 10.0.5.2 100 0 (64512) 64515 i
*>c192.168.2.0/24 10.0.5.2 100 0 (64512) 64515 i
*>c192.168.3.0/24 10.0.5.2 100 0 (64512) 64515 i
*>c192.168.4.0/24 10.0.5.2 100 0 (64512) 64515 i
*>c192.168.5.0/24 10.0.5.2 100 0 (64512) 64515 i
*>c192.168.6.0/24 10.0.5.2 100 0 (64512) 64515 i
*>c192.168.7.0/24 10.0.5.2 100 0 (64512) 64515 i
*>c192.168.8.0/24 10.0.5.2 100 0 (64512) 64515 i
Nexus 3
步骤 1:建立BGP邻居并交换前缀。
Nexus3# show ip bgp summary
BGP summary information for VRF default, address family IPv4 Unicast
BGP router identifier 172.16.255.3, local AS number 64512
BGP table version is 34, IPv4 Unicast config peers 1, capable peers 1
16 network entries and 16 paths using 4416 bytes of memory
BGP attribute entries [2/704], BGP AS path entries [2/12]
BGP community entries [0/0], BGP clusterlist entries [0/0]
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/
PfxRcd
172.16.255.1 4 64512 332 323 34 0 0 05:17:52 16
第2步:从Nexus 3的角度,将前缀获知为正常iBGP前缀。从它的角度来看,它没有任何联盟邻居,并且它唯一的对等体是iBGP对等体。
Nexus3# show ip bgp
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 34, Local Router ID is 172.16.255.3
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-i
njected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup, 2 - b
est2
Network Next Hop Metric LocPrf Weight Path
*>i172.30.1.0/24 172.16.255.4 100 0 (64514) i
*>i172.30.2.0/24 172.16.255.4 100 0 (64514) i
*>i172.30.3.0/24 172.16.255.4 100 0 (64514) i
*>i172.30.4.0/24 172.16.255.4 100 0 (64514) i
*>i172.30.5.0/24 172.16.255.4 100 0 (64514) i
*>i172.30.6.0/24 172.16.255.4 100 0 (64514) i
*>i172.30.7.0/24 172.16.255.4 100 0 (64514) i
*>i172.30.8.0/24 172.16.255.4 100 0 (64514) i
*>i192.168.1.0/24 10.0.5.2 100 0 64515 i
*>i192.168.2.0/24 10.0.5.2 100 0 64515 i
*>i192.168.3.0/24 10.0.5.2 100 0 64515 i
*>i192.168.4.0/24 10.0.5.2 100 0 64515 i
*>i192.168.5.0/24 10.0.5.2 100 0 64515 i
*>i192.168.6.0/24 10.0.5.2 100 0 64515 i
*>i192.168.7.0/24 10.0.5.2 100 0 64515 i
*>i192.168.8.0/24 10.0.5.2 100 0 64515 i
Nexus 4
步骤 1:建立BGP邻居并交换前缀。
Nexus4# show ip bgp summary
BGP summary information for VRF default, address family IPv4 Unicast
BGP router identifier 172.16.255.4, local AS number 64514
BGP table version is 18, IPv4 Unicast config peers 1, capable peers 1
16 network entries and 16 paths using 4416 bytes of memory
BGP attribute entries [2/704], BGP AS path entries [1/12]
BGP community entries [0/0], BGP clusterlist entries [0/0]
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.16.255.2 4 64514 268 267 18 0 0 04:21:40 8
步骤 2: 从Nexus 4的角度来看,前缀是作为正常iBGP前缀学习的。从它的角度来看,它没有任何联盟邻居,并且它唯一的对等体是iBGP对等体。
Nexus4# show ip bgp
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 18, Local Router ID is 172.16.255.4
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup, 2 - best2
Network Next Hop Metric LocPrf Weight Path
*>l172.30.1.0/24 0.0.0.0 100 32768 i
*>l172.30.2.0/24 0.0.0.0 100 32768 i
*>l172.30.3.0/24 0.0.0.0 100 32768 i
*>l172.30.4.0/24 0.0.0.0 100 32768 i
*>l172.30.5.0/24 0.0.0.0 100 32768 i
*>l172.30.6.0/24 0.0.0.0 100 32768 i
*>l172.30.7.0/24 0.0.0.0 100 32768 i
*>l172.30.8.0/24 0.0.0.0 100 32768 i
*>i192.168.1.0/24 10.0.5.2 100 0 (64512) 64515 i
*>i192.168.2.0/24 10.0.5.2 100 0 (64512) 64515 i
*>i192.168.3.0/24 10.0.5.2 100 0 (64512) 64515 i
*>i192.168.4.0/24 10.0.5.2 100 0 (64512) 64515 i
*>i192.168.5.0/24 10.0.5.2 100 0 (64512) 64515 i
*>i192.168.6.0/24 10.0.5.2 100 0 (64512) 64515 i
*>i192.168.7.0/24 10.0.5.2 100 0 (64512) 64515 i
*>i192.168.8.0/24 10.0.5.2 100 0 (64512) 64515 i
Nexus 5
步骤 1:建立BGP邻居并交换前缀。在这种情况下,唯一的邻居是Nexus 3,这是eBGP邻居。
Nexus5# show ip bgp summary
BGP summary information for VRF default, address family IPv4 Unicast
BGP router identifier 172.16.255.5, local AS number 64515
BGP table version is 18, IPv4 Unicast config peers 1, capable peers 1
16 network entries and 16 paths using 3904 bytes of memory
BGP attribute entries [2/344], BGP AS path entries [1/6]
BGP community entries [0/0], BGP clusterlist entries [0/0]
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.0.5.1 4 64513 317 317 18 0 0 05:11:26 8
步骤 2:从Nexus 5的角度来看,从Nexus 3接收的前缀是使用联盟ASN的AS PATH接收的,但作为正常eBGP前缀接收。
Nexus5# show ip bgp
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 18, Local Router ID is 172.16.255.5
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-i
njected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup, 2 - b
est2
Network Next Hop Metric LocPrf Weight Path
*>e172.30.1.0/24 10.0.5.1 0 64513 i
*>e172.30.2.0/24 10.0.5.1 0 64513 i
*>e172.30.3.0/24 10.0.5.1 0 64513 i
*>e172.30.4.0/24 10.0.5.1 0 64513 i
*>e172.30.5.0/24 10.0.5.1 0 64513 i
*>e172.30.6.0/24 10.0.5.1 0 64513 i
*>e172.30.7.0/24 10.0.5.1 0 64513 i
*>e172.30.8.0/24 10.0.5.1 0 64513 i
*>l192.168.1.0/24 0.0.0.0 100 32768 i
*>l192.168.2.0/24 0.0.0.0 100 32768 i
*>l192.168.3.0/24 0.0.0.0 100 32768 i
*>l192.168.4.0/24 0.0.0.0 100 32768 i
*>l192.168.5.0/24 0.0.0.0 100 32768 i
*>l192.168.6.0/24 0.0.0.0 100 32768 i
*>l192.168.7.0/24 0.0.0.0 100 32768 i
*>l192.168.8.0/24 0.0.0.0 100 32768 i
注意:Nexus 5不知道Nexus 1 - Nexus 4之间使用的联盟。从它的角度来看,这些是普通eBGP前缀。