此产品的文档集力求使用非歧视性语言。在本文档集中,非歧视性语言是指不隐含针对年龄、残障、性别、种族身份、族群身份、性取向、社会经济地位和交叉性的歧视的语言。由于产品软件的用户界面中使用的硬编码语言、基于 RFP 文档使用的语言或引用的第三方产品使用的语言,文档中可能无法确保完全使用非歧视性语言。 深入了解思科如何使用包容性语言。
思科采用人工翻译与机器翻译相结合的方式将此文档翻译成不同语言,希望全球的用户都能通过各自的语言得到支持性的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 Cisco Systems, Inc. 对于翻译的准确性不承担任何责任,并建议您总是参考英文原始文档(已提供链接)。
本文档介绍如何在仅具有边界网关协议(BGP)的Cisco Catalyst 9000系列交换机上实施和验证虚拟可扩展LAN (VXLAN)以太网VPN (EVPN)。
Cisco 建议您了解以下主题:
本文档中的信息基于以下软件和硬件版本:
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
设计下一代园区网络需要采用现代技术和架构来满足用户、应用和设备不断发展的需求。采用BGP EVPN 解决方案的VXLAN可以提供基于交换矩阵的架构,以实现简便性、可扩展性和易管理性。 本文档介绍适用于因任何原因而倾向于将BGP用于IPv4和EVPN路由的用户的BGP EVPN解决方案。
具有BGP EVPN的VXLAN使用主干-枝叶架构,而不是传统的3层网络模型。使用主干-枝叶架构,主干充当接入交换机之间的高速管道。主干模式支持横向扩展模式,其中可通过添加更多主干增加枝叶之间的带宽,或通过添加更多枝叶增加终端容量。
对于喜欢将BGP用于IPv4和EVPN路由信息的用户,请包括以下注意事项:
此拓扑显示了一个常见的C9K EVPN单交换矩阵设计。
对于仅BGP设计,要考虑的第一个问题是使用内部BGP (IBGP)还是外部BGP (EBGP)。使用IBGP的情况,这在传统DC的VxLAN EVPN中很常见。与使用IBGP作为底层相比,使用EBGP时,无需将主干配置为路由反射器,而是用作交换路由的传统路由器服务器。因此,本文档的前提条件是使用EBGP。
选项1.2-AS:主干使用一个AS,枝叶和边界枝叶使用另一个AS。
Two-AS
第 2 项.多AS:主干、枝叶和边界枝叶均使用一个AS。
比较这两种设计时,常见的问题是可扩展性,因为对于选项2,每次添加主干或枝叶时,都需要添加新的AS编号,这会在将来带来更复杂的配置更改,不利于扩展和维护。因此,本文档使用选项1.进行讨论。
与使用IBGP作为底层相比,使用EBGP时,无需将主干配置为路由反射器,而是用作交换路由的传统路由器服务器。
这些是在衬底平面中需要考虑的关键点。
AS环路检测通过扫描完整的AS路径(在AS_PATH属性中指定)并检查本地系统的自主系统编号是否未出现在AS路径中来完成。
根据上图,形成BGP AS环路-与本场景中as-path中的AS编号相同:
要解决此问题,请在BGP IPv4地址系列中配置allow-as-in,其说明概述如下:
注意:将单一交换矩阵用于DGW时,不太可能需要从一个主干到另一个主干。但是,考虑到拓扑更改(例如超级主干),建议同时禁用主干设备上的AS检查。
BGP根据其条件选择路由,默认情况下不会在BGP表中显示2个ECMP路由。要实现ECMP以优化带宽,必须在所有BGP运行设备中的BGP IPv4地址系列中配置“maximum-paths X”。同时,作为最佳实践,我们建议保持主干和枝叶之间的相同链路带宽。
注意:最大路径取决于拓扑设计。使用两台主干交换机,可以配置“maximum-paths 2”。
在重叠平面中需要考虑这些要点。
AS环路检测通过扫描完整的AS路径(在AS_PATH属性中指定)并检查本地系统的自主系统编号是否未出现在AS路径中来完成。
根据映像,形成BGP AS环路-在此场景中,AS路径中的AS编号相同:
要解决此问题,必须在BGP IPv4地址系列中配置allow-as-in,其说明概述如下:
注意:将单一交换矩阵用于DGW时,不太可能需要从一个主干到另一个主干。但是,考虑到拓扑更改(例如超级主干),建议同时禁用主干设备上的AS检查。
默认情况下,BGP会更改从EBGP邻居通告的网络层可达性信息(NLRI)的下一跳属性。枝叶/VXLAN隧道终端(VTEP)使用其NVE源地址作为EVPN路由的下一跳属性,并且此地址用于确定VXLAN隧道(网络虚拟接口/NVE对等体)的目标。如果主干节点更改下一跳,则VXLAN隧道无法正确建立。
要解决此问题,请按照以下说明进行操作。
来自枝叶设备的EVPN路由通过路由目标(RT)社区进行通告。默认情况下,没有相应RT配置的路由器会丢弃具有RT社区的路由。而所有主干设备均未配置虚拟路由和转发(VRF)。这意味着默认情况下,主干设备会丢弃从枝叶设备通告的所有EVPN路由。
要解决此问题,需要在所有主干节点上禁用默认路由目标过滤器。
本实验环境的接口详细信息如下。
设备名 |
软件版本 |
接口号 |
IP Address |
主干-1 |
IOS-XE 17.12.1 |
Hu 1/0/9 |
172.16.12.1/30 |
Hu 1/0/10 |
172.16.11.1/30 |
||
Lo 0 |
10.1.255.1/32 |
||
主干-2 |
IOS-XE 17.12.1 |
Hu 1/0/9 |
172.16.21.1/30 |
Hu 1/0/10 |
172.16.22.1/30 |
||
Lo 0 |
10.1.255.2/32 |
||
枝叶-1 |
IOS-XE 17.12.1 |
Hu 1/0/1 |
172.16.21.2/30 |
Hu 1/0/2 |
172.16.11.2/30 |
||
第1步 |
10.2.254.1/32 |
||
枝叶-2 |
IOS-XE 17.12.1 |
Hu 1/0/1 |
172.16.12.2/30 |
Hu 1/0/2 |
172.16.22.2/30 |
||
第1步 |
10.2.254.2/32 |
注意:本实验中的IP地址分配仅用于测试目的。可以根据您的实际设计要求考虑点对点连接的子网掩码(即/30、/31)。
在本示例中,物理接口用于建立BGP连接。
主干上的配置:
router bgp 65001
bgp log-neighbor-changes
bgp listen range 172.16.0.0/16 peer-group Leaf-Peers
no bgp default ipv4-unicast
neighbor Leaf-Peers peer-group
neighbor Leaf-Peers remote-as 65002
!
address-family ipv4
redistribute connected
neighbor Leaf-Peers activate
neighbor Leaf-Peers allowas-in 1
maximum-paths 2
exit-address-family
枝叶-1上的配置:
router bgp 65002
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 172.16.11.1 remote-as 65001
neighbor 172.16.21.1 remote-as 65001
!
address-family ipv4
redistribute connected
neighbor 172.16.11.1 activate
neighbor 172.16.21.1 activate
exit-address-family
枝叶-2上的配置:
router bgp 65002
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 172.16.12.1 remote-as 65001
neighbor 172.16.22.1 remote-as 65001
!
address-family ipv4
redistribute connected
neighbor 172.16.12.1 activate
neighbor 172.16.22.1 activate
exit-address-family
主干上的配置:
router bgp 65001
address-family ipv4
neighbor Leaf-Peers allowas-in 1
枝叶-1上的配置:
router bgp 65002
address-family ipv4
neighbor 172.16.11.1 allowas-in 1
neighbor 172.16.21.1 allowas-in 1
枝叶-2上的配置:
router bgp 65002
address-family ipv4
neighbor 172.16.12.1 allowas-in 1
neighbor 172.16.22.1 allowas-in 1
主干上的配置:
router bgp 65001
address-family ipv4
maximum-paths 2
枝叶上的配置:
router bgp 65002
address-family ipv4
maximum-paths 2
要启用组播复制(MR)来处理广播、未知单播和本地链路组播(BUM)流量,所有主干和枝叶设备上都需要组播路由。所有主干和枝叶连接接口和相关环回都必须启用PIM。
主干1上的底层组播示例:
ip multicast-routing
ip pim rp-address 10.1.255.1 //configure Spine loopback as RP
interface Loopback0
ip pim sparse-mode
interface HundredGigE1/0/9
ip pim sparse-mode
interface HundredGigE1/0/10
ip pim sparse-mode
主干上的配置:
router bgp 65001
neighbor Leaf-Peers ebgp-multihop 255
address-family l2vpn evpn
neighbor Leaf-Peers activate
neighbor Leaf-Peers send-community both
枝叶-1上的配置:
router bgp 65002
neighbor 172.16.11.1 ebgp-multihop 255
neighbor 172.16.21.1 ebgp-multihop 255
address-family l2vpn evpn
neighbor 172.16.11.1 activate
neighbor 172.16.11.1 send-community both
neighbor 172.16.21.1 activate
neighbor 172.16.21.1 send-community both
枝叶-2上的配置:
router bgp 65002
neighbor 172.16.12.1 ebgp-multihop 255
neighbor 172.16.22.1 ebgp-multihop 255
address-family l2vpn evpn
neighbor 172.16.12.1 activate
neighbor 172.16.12.1 send-community both
neighbor 172.16.22.1 activate
neighbor 172.16.22.1 send-community both
枝叶-1上的配置:
router bgp 65002
address-family l2vpn evpn
neighbor 172.16.11.1 allowas-in 1
neighbor 172.16.21.1 allowas-in 1
枝叶-2上的配置:
router bgp 65002
address-family l2vpn evpn
neighbor 172.16.12.1 allowas-in 1
neighbor 172.16.22.1 allowas-in 1
注意:将单一交换矩阵用于DGW时,不太可能需要从一个主干到另一个主干。但是,考虑到拓扑更改(例如超级主干),建议同时禁用主干设备上的AS检查。
主干上的配置:
route-map BGP-NHU permit 10
set ip next-hop unchanged
!
router bgp 65001
address-family l2vpn evpn
neighbor Leaf-Peers route-map BGP-NHU out
主干上的配置:
router bgp 65001
no bgp default route-target filter
vrf definition S1-EVPN
rd 1:1
!
address-family ipv4
route-target export 1:1
route-target import 1:1
route-target export 1:1 stitching
route-target import 1:1 stitching
exit-address-family
router bgp 65002
address-family ipv4 vrf S1-EVPN
advertise l2vpn evpn
redistribute connected
maximum-paths 2
exit-address-family
在枝叶上启用L2VPN EVPN和组播复制:
l2vpn evpn
replication-type static
在枝叶上创建EVPN实例(EVI):
l2vpn evpn instance 10 vlan-based
encapsulation vxlan
l2vpn evpn instance 20 vlan-based
encapsulation vxlan
在枝叶上为用户流量创建VLAN和VNI:
vlan configuration 10
member evpn-instance 10 vni 10010
vlan configuration 20
member evpn-instance 20 vni 10020
创建NVE接口并将VNI缝合到枝叶上的组播组。
interface nve1
no ip address
source-interface Loopback1
host-reachability protocol bgp
member vni 10010 mcast-group 225.0.0.10
member vni 10020 mcast-group 225.0.0.20
在枝叶上为L3VNI创建VLAN。L3VNI不需要EVI。
vlan configuration 3000
member vni 33000
在枝叶上为L2VNI配置SVI。
interface Vlan10
mac-address 0010.0010.0010
vrf forwarding S1-EVPN
ip address 192.168.10.254 255.255.255.0
在枝叶上为L3VNI配置SVI。将“no autostate”配置为在未向该VLAN分配活动接口时启动SVI。
interface Vlan3000
vrf forwarding S1-EVPN
ip unnumbered Loopback1
no autostate
在枝叶上,将L3VNI缝合到NVE配置下的VRF。
interface nve1
member vni 33000 vrf S1-EVPN
验证BGP会话已建立
C9600X-SPINE-1#show ip bgp all summary For address family: IPv4 Unicast BGP router identifier 10.1.255.1, local AS number 65001 BGP table version is 23, main routing table version 23 12 network entries using 2976 bytes of memory 22 path entries using 2992 bytes of memory 2 multipath network entries and 4 multipath paths 4/3 BGP path/bestpath attribute entries using 1184 bytes of memory 3 BGP AS-PATH entries using 104 bytes of memory 8 BGP extended community entries using 400 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 7656 total bytes of memory BGP activity 7259/7235 prefixes, 13926/13892 paths, scan interval 60 secs 12 networks peaked at 07:06:41 Dec 5 2023 UTC (2w1d ago) Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd *172.16.11.2 4 65002 138 130 23 0 0 01:38:17 9 *172.16.12.2 4 65002 138 130 23 0 0 01:38:11 9 * Dynamically created based on a listen range command Dynamically created neighbors: 2, Subnet ranges: 1 BGP peergroup Leaf-Peers listen range group members: 172.16.0.0/16 For address family: L2VPN E-VPN BGP router identifier 10.1.255.1, local AS number 65001 BGP table version is 27, main routing table version 27 10 network entries using 3840 bytes of memory 12 path entries using 2784 bytes of memory 8/6 BGP path/bestpath attribute entries using 2368 bytes of memory 3 BGP AS-PATH entries using 104 bytes of memory 8 BGP extended community entries using 400 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 9496 total bytes of memory BGP activity 7259/7235 prefixes, 13926/13892 paths, scan interval 60 secs 12 networks peaked at 07:38:03 Dec 6 2023 UTC (2w0d ago) Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd *172.16.11.2 4 65002 138 130 27 0 0 01:38:17 6 *172.16.12.2 4 65002 138 130 27 0 0 01:38:11 6 * Dynamically created based on a listen range command Dynamically created neighbors: 2, Subnet ranges: 1 BGP peergroup Leaf-Peers listen range group members: 172.16.0.0/16 Total dynamically created neighbors: 2/(100 max), Subnet ranges: 1
C9500X-LEAF-1#show ip bgp all summary For address family: IPv4 Unicast BGP router identifier 10.2.255.1, local AS number 65002 BGP table version is 19, main routing table version 19 12 network entries using 2976 bytes of memory 22 path entries using 2992 bytes of memory 2 multipath network entries and 4 multipath paths 4/3 BGP path/bestpath attribute entries using 1184 bytes of memory 3 BGP AS-PATH entries using 104 bytes of memory 8 BGP extended community entries using 384 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 7640 total bytes of memory BGP activity 577/545 prefixes, 4021/3975 paths, scan interval 60 secs 12 networks peaked at 07:10:16 Dec 5 2023 UTC (1d18h ago) Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 172.16.11.1 4 65001 2427 3100 19 0 0 20:39:49 9 172.16.21.1 4 65001 2430 3094 19 0 0 20:39:49 9 For address family: L2VPN E-VPN BGP router identifier 10.2.255.1, local AS number 65002 BGP table version is 5371, main routing table version 5371 16 network entries using 6144 bytes of memory 20 path entries using 4640 bytes of memory 9/9 BGP path/bestpath attribute entries using 2664 bytes of memory 3 BGP AS-PATH entries using 104 bytes of memory 8 BGP extended community entries using 384 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 13936 total bytes of memory BGP activity 577/545 prefixes, 4021/3975 paths, scan interval 60 secs 16 networks peaked at 07:36:38 Dec 6 2023 UTC (18:16:58.620 ago) Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 172.16.11.1 4 65001 2427 3100 5371 0 0 20:39:49 4 172.16.21.1 4 65001 2430 3094 5371 0 0 20:39:49 4
Initiate traffic between hosts, verify IP Multicast and PIM configuration, and mroute table.
Please note that on IOS-XE platform, (*, G) entry should always present, and (S, G) entry presents only when BUM traffic present.
C9600X-SPINE-1#show ip mroute IP Multicast Routing Table <snip> Outgoing interface flags: H - Hardware switched, A - Assert winner, p - PIM Join t - LISP transit group Timers: Uptime/Expires Interface state: Interface, Next-Hop or VCD, State/Mode (*, 225.0.0.20), 16:51:00/stopped, RP 10.1.255.1, flags: SJCx Incoming interface: HundredGigE1/0/2, RPF nbr 172.16.11.1 Outgoing interface list: Tunnel0, Forward/Sparse-Dense, 16:51:00/00:02:58, flags: (*, 225.0.0.10), 16:51:14/stopped, RP 10.1.255.1, flags: SJCFx Incoming interface: HundredGigE1/0/2, RPF nbr 172.16.11.1 Outgoing interface list: Tunnel0, Forward/Sparse-Dense, 16:51:14/00:02:45, flags: (10.2.254.1, 225.0.0.10), 00:00:01/00:02:57, flags: FTx Incoming interface: Loopback1, RPF nbr 0.0.0.0, Registering Outgoing interface list: HundredGigE1/0/2, Forward/Sparse, 00:00:01/00:03:27, flags: (*, 224.0.1.40), 1d18h/00:02:42, RP 10.1.255.1, flags: SJCL Incoming interface: HundredGigE1/0/2, RPF nbr 172.16.11.1 Outgoing interface list: Loopback0, Forward/Sparse, 1d18h/00:02:42, flags
检验EVPN L2
C9500X-LEAF-1#show l2vpn evpn evi 10 detail EVPN instance: 10 (VLAN Based) RD: 10.2.254.1:10 (auto) Import-RTs: 65002:10 Export-RTs: 65002:10 <snip> C9500X-LEAF-1#show nve peers 'M' - MAC entry download flag 'A' - Adjacency download flag '4' - IPv4 flag '6' - IPv6 flag Interface VNI Type Peer-IP RMAC/Num_RTs eVNI state flags UP time nve1 33000 L3CP 10.2.254.2 242a.0412.0102 33000 UP A/M/4 18:11:35 nve1 10010 L2CP 10.2.254.2 2 10010 UP N/A 00:36:00 nve1 10020 L2CP 10.2.254.2 2 10020 UP N/A 00:01:17 C9500X-LEAF-1#show bgp l2vpn evpn BGP table version is 5475, local router ID is 10.2.254.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, t secondary path, L long-lived-stale, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path Route Distinguisher: 10.2.254.1:10 *> [2][10.2.254.1:10][0][48][683B78FC8C9F][0][*]/20 10.2.254.2 0 65001 65002 ? *> [2][10.2.254.1:10][0][48][683B78FC8C9F][32][192.168.10.45]/24 10.2.254.2 0 65001 65002 ? <snip> C9500X-LEAF-1#show bgp l2vpn evpn detail [2][10.2.254.1:10][0][48][683B78FC8C9F][32][192.168.10.45]/24 BGP routing table entry for [2][10.2.254.1:10][0][48][683B78FC8C9F][32][192.168.10.45]/24, version 5371 Paths: (1 available, best #1, table evi_10) Not advertised to any peer Refresh Epoch 12 65001 65002, imported path from [2][10.2.254.2:10][0][48][683B78FC8C9F][32][192.168.10.45]/24 (global) 10.2.254.2 (via default) from 172.16.21.1 (10.1.255.2) Origin incomplete, localpref 100, valid, external, best EVPN ESI: 00000000000000000000, Label1 10010, Label2 33000 Extended Community: RT:1:1 RT:65002:10 ENCAP:8 Router MAC:242A.0412.0102 rx pathid: 0, tx pathid: 0x0 Updated on Dec 7 2023 01:52:33 UTC C9500X-LEAF-1#show device-tracking database <snip> Network Layer Address Link Layer Address Interface vlan prlvl age state Time left ARP 192.168.20.25 3c13.cc01.a7df Hu1/0/7 20 0005 3mn REACHABLE 103 s ARP 192.168.10.25 3c13.cc01.a7df Hu1/0/7 10 0005 20mn STALE try 0 943 s C9500X-LEAF-1#show l2vpn evpn mac ip IP Address EVI VLAN MAC Address Next Hop(s) --------------------------------------- ----- ----- -------------- ----------- 192.168.10.25 10 10 3c13.cc01.a7df Hu1/0/7:10 192.168.10.45 10 10 683b.78fc.8c9f 10.2.254.2
检验EVPN L3
C9500X-LEAF-1#show nve peers 'M' - MAC entry download flag 'A' - Adjacency download flag '4' - IPv4 flag '6' - IPv6 flag Interface VNI Type Peer-IP RMAC/Num_RTs eVNI state flags UP time nve1 33000 L3CP 10.2.254.2 242a.0412.0102 33000 UP A/M/4 18:50:51 nve1 10010 L2CP 10.2.254.2 2 10010 UP N/A 01:15:16 nve1 10020 L2CP 10.2.254.2 2 10020 UP N/A 00:31:39 9500X-LEAF-1#sh bgp l2vpn evpn BGP table version is 5523, local router ID is 10.2.255.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, t secondary path, L long-lived-stale, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path <snip> Route Distinguisher: 1:1 (default for vrf S1-EVPN) *> [5][1:1][0][24][192.168.10.0]/17 0.0.0.0 0 32768 ? *> [5][1:1][0][24][192.168.20.0]/17 0.0.0.0 0 32768 ? C9500X-LEAF-1#sh ip ro vrf S1-EVPN Routing Table: S1-EVPN <snip> 192.168.10.0/24 is variably subnetted, 4 subnets, 2 masks C 192.168.10.0/24 is directly connected, Vlan10 S 192.168.10.25/32 is directly connected, Vlan10 B 192.168.10.45/32 [20/0] via 10.2.254.2, 00:00:56, Vlan3000 L 192.168.10.254/32 is directly connected, Vlan10 192.168.20.0/24 is variably subnetted, 4 subnets, 2 masks C 192.168.20.0/24 is directly connected, Vlan20 S 192.168.20.25/32 is directly connected, Vlan20 B 192.168.20.45/32 [20/0] via 10.2.254.2, 00:49:54, Vlan3000 L 192.168.20.254/32 is directly connected, Vlan20
版本 | 发布日期 | 备注 |
---|---|---|
1.0 |
12-Feb-2024 |
初始版本 |