配置 BGP 未编号的 EVPN 交换矩阵
总结 快速配置 BGP 无编号对等功能。
概述
从 Junos OS 21.1R1 版开始,瞻博网络支持 BGP 未编号(自动发现)对等互连。此功能会在 EVPN-VXLAN 交换矩阵底层中自动配置 BGP 对等互连和相关路由交换。底层的 E-BGP 对等互连使用直接连接的交换矩阵设备的动态发现的链路本地 IPv6 地址。
配置 BGP 无编号对等时,只需配置最小编号配置语句。这些配置语句用于快速启动基于 IPv6 的底层。此底层支持 EVPN-VXLAN 叠加。虽然底层使用本机 IPv6,但它也支持带有 IPv6 下一跃点 (RFC5549) 的 IPv4 路由。这意味着底层在 EVPN-VXLAN 叠加网络中同时支持 IPv4 和 IPv6 工作负载及其相关虚拟网络 (VLAN)。本文不全面讨论 IPv6 无状态自动配置。
以下列表重点介绍了 BGP 无编号对等互连的主要功能:
- 在所有支持 IPv6 的接口上自动配置无状态链路本地 IPv6 地址。
- 支持允许的 AS 编号列表,以简化与远程交换矩阵设备的对等连接。
- 使用可动态发现直连邻接邻的 IPv6 路由器通告 (EA)。
- 使用 IPv6 邻接方发现将邻居的链路本地 IP 解析到相应的 MAC 地址,以促进链路级别通信。
- 本地端使用发现的对等链路本地地址和 MAC 地址向直连邻接方发送 BGP 开放消息。此打开的消息包含本地对等方的 AS 编号。远程对等方将其与其允许的 AS 编号列表匹配,以决定是否允许该会话。同样,本地对等方与远程对等方打开消息中返回的远程对等方 AS 编号匹配。
- 为您提供一个简单的 BGP 策略,可播发所有直连网络(至少,必须播发每个交换矩阵设备的环路地址)。
- 使用默认 E-BGP 策略重新播发从其他交换矩阵设备学习的路由。
- 使用 BGP AS 路径长度是为了防止环路并为 ECMP 负载平衡提供最佳路由选择。
- 由于底层提供环路可访问性,因此您可以轻松添加 EVPN-VXLAN 叠加。
BGP 无编号对等仅支持 EBGP。不支持多跳 EBGP 和 IBGP。
要求
暂存此 NCE 的要求包括:
-
Junos OS 或 Junos OS Evolved 21.1R1 或更高版本。有关受支持的设备和操作系统版本的完整列表,请参阅 支持的瞻博网络设备。
-
-
拓扑
以下拓扑显示了一个简单的两个主干和两个叶式拓扑。在下一节中执行 分步配置 时,请参阅此拓扑。有关拓扑的一些注意事项包括:

- 交换矩阵底层是纯 IPv6。这包括设备环路地址。
- 连接的工作负载基于 IPv4。这是为了展示对 IPv4 over IPv6 (RFC 5549) 的支持。叠加还支持 IPv6 工作负载。您可以假设这些是预配置的裸机服务器 (BMS),并预配置了显示的 IP 寻址。VLAN 成员资格用于将这些工作负载映射到通过 VXLAN 封装隔离的叠加 VLAN。此示例中未标记接入接口。
- 在添加叠加时,您期望在服务器工作负载之间具有路由连接。叠加可以是集中路由桥接 (CRB) 或边缘路由桥接 (ERB)。BGP 未编号的底层支持任一类型的叠加。有关 EVPN-VXLAN 叠加架构选项的信息,请参阅 EVPN 入门 。
逐步配置
本节提供有关如何配置 BGP 无编号对等互连的分步说明。由于所有交换矩阵设备上的配置都相似,因此叶 1 设备的配置仅在此处显示。
为了帮助您快速启动和运行,我们在“快速配置”中提供了交换矩阵设备的配置。
分步配置:枝叶 1
-
在所有交换矩阵接口上启用此
inet6
系列。这些交换矩阵接口将叶连接到主干设备。该inet6
系列支持 IPv6 无状态自动配置和邻居发现。要支持 IPv4 工作负载,还必须添加该inet
系列。set interfaces xe-0/0/0 unit 0 family inet6 set interfaces xe-0/0/0 unit 0 family inet set interfaces xe-0/0/1 unit 0 family inet6 set interfaces xe-0/0/1 unit 0 family inet
注意:如果您有大量交换矩阵接口,请考虑使用配置组。此配置组将此
inet6
系列应用于第一个 FPC 和 PIC 上的所有 10GE 接口。配置组不会创建接口。要使此配置组起作用,接口必须已存在于配置中(例如,接口仅显示接口说明或一些其他接口参数,如 IPv4 地址)。root@leaf1# show groups v6-unnum interfaces { "<xe-0/0/[*]>" { unit 0 { family inet; family inet6; } } } root@leaf1# show apply-groups apply-groups v6-unnum;
-
创建环路接口并配置 IPv6 地址。在添加 EVPN-VXLAN 叠加时,环路地址用于支持 BGP 对等。
set interfaces lo0 unit 0 family inet6 address 2001:db8:100::3/128
-
配置一个策略,以指定要允许动态 BGP 对等的 BGP AS 编号列表。
set policy-options as-list a-list members [65000-65100]
注意:对 AS 编号列表的 Junos OS 支持是 BGP 无编号对等解决方案的关键组件。AS 编号列表简化了动态 BGP 对等互连,因为它无需显式列出与每个直连对等方关联的 AS 编号。
-
配置按数据包的负载平衡策略。负载平衡策略允许在转发表中安装多个等价下一跃点。这在链路故障的通风口中为替代等价交换矩阵跃点提供了快速故障转移。
set policy-options policy-statement load-balancing-policy then load-balance per-packet
-
将按数据包的负载平衡策略应用于转发表。
set routing-options forwarding-table export load-balancing-policy
-
配置策略以播发直接路由。由于未导出链路本地子网,因此在此示例中,此策略仅播发环路地址。稍后,在叠加中配置 BGP 对等互连时,您将使用此相同的环路地址。
set policy-options policy-statement DIRECT-RTS from protocol direct set policy-options policy-statement DIRECT-RTS then accept
-
配置路由器 ID (RID)。由于这是本机 IPv6 交换矩阵的示例,因此必须确保有 IPv4 格式的路由器 ID 可用。在大多数情况下,RID 会自动从环路地址派生,但在此示例中,环路仅是 IPv6。
set routing-options router-id 10.0.0.4
-
在所有交换矩阵接口上配置路由器通告。启用 RA 后,接口会定期发送 RA 消息。RA 消息用于发现远程邻接方的链路本地 IP,进而启动邻接方发现和动态对等过程的其余部分。
set protocols router-advertisement interface xe-0/0/0 set protocols router-advertisement interface xe-0/0/1
-
配置 BGP 组以支持无编号对等。将导出直接路由的策略应用于此组。您必须在此组中包括所有交换矩阵接口,并且必须启用
peer-auto-discovery
它们。此组链接到定义允许动态对等连接的 AS 编号的策略。您可以在多个路径和多个 AS 编号上实现负载平衡。请记住,在此交换矩阵中,每个节点都使用唯一的 AS 编号。通过允许 RIB 安装指向这些不同 AS 编号的下一跃点,将多路径负载平衡 (ECMP) 到多个 AS 编号,从而实现快速故障转移。添加对扩展 IPv4 nexthops 的支持允许通过 IPv6 BGP 会话进行 IPv4 路由交换。
set protocols bgp group auto-disc family inet6 unicast set protocols bgp group auto-disc family inet unicast extended-nexthop set protocols bgp group auto-disc export DIRECT-RTS set protocols bgp group auto-disc local-as 65003 set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery family inet6 ipv6-nd set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery interface xe-0/0/0 set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery interface xe-0/0/1 set protocols bgp group auto-disc peer-as-list a-list set protocols bgp group auto-disc multipath multiple-as
结果
回想一下,所有交换矩阵设备的配置都相似。为简洁起想,仅显示叶 1 的配置 delta。
user@leaf-1> show configuration system { host-name leaf1; } interfaces { xe-0/0/0 { unit 0 { family inet; family inet6; } } xe-0/0/1 { unit 0 { family inet; family inet6; } } lo0 { unit 0 { family inet6 { address 2001:db8:100::3/128; } } } } policy-options { policy-statement DIRECT-RTS { from protocol direct; then accept; } policy-statement load-balancing-policy { then load-ballance per-packet; } as-list a-list members 65000-65100; } routing-options { router-id 10.0.0.3; forwarding-table { export load-balancing-policy; } } protocols { router-advertisement { interface xe-0/0/0.0; interface xe-0/0/1.0; } bgp { group auto-disc { family inet6 { unicast; } family inet { unicast { extended-nexthop; } } export DIRECT-RTS; local-as 65003; multipath; dynamic-neighbor FABRIC { peer-auto-discovery { family inet6 { ipv6-nd; } interface xe-0/0/0.0; interface xe-0/0/1.0; } } peer-as-list a-list; } } }
快速配置
为了让您快速启动并运行,我们为您提供了拓扑中每个节点的快速配置。请确保编辑这些配置以匹配交换矩阵的具体情况,并将其粘贴到相应的交换矩阵节点中。
CLI 快速配置
设备配置省略了管理接口、静态路由、系统日志记录、系统服务和用户登录信息。这些配置部分因位置而异,并且与 BGP 未编号的对等功能不直接相关。
针对环境细节,根据需要编辑以下命令,并在处于层次结构的配置模式下 [edit]
将其粘贴到相关交换矩阵设备的终端窗口中:
叶 1 的快速配置:
set system host-name leaf1 set interfaces xe-0/0/0 unit 0 family inet set interfaces xe-0/0/1 unit 0 family inet set interfaces xe-0/0/0 unit 0 family inet6 set interfaces xe-0/0/1 unit 0 family inet6 set interfaces lo0 unit 0 family inet6 address 2001:db8:100::3/128 set policy-options as-list a-list members [65000-65100] set policy-options policy-statement DIRECT-RTS from protocol direct set policy-options policy-statement DIRECT-RTS then accept set policy-options policy-statement load-balancing-policy then load-balance per-packet set protocols router-advertisement interface xe-0/0/0 set protocols router-advertisement interface xe-0/0/1 set protocols bgp group auto-disc family inet6 unicast set protocols bgp group auto-disc export DIRECT-RTS set protocols bgp group auto-disc local-as 65003 set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery family inet6 ipv6-nd set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery interface xe-0/0/0 set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery interface xe-0/0/1 set protocols bgp group auto-disc peer-as-list a-list set protocols bgp group auto-disc multipath multiple-as set routing-options forwarding-table export load-balancing-policy set routing-options router-id 10.0.0.3
叶 2 的快速配置:
set system host-name leaf2 set interfaces xe-0/0/0 unit 0 family inet set interfaces xe-0/0/1 unit 0 family inet set interfaces xe-0/0/0 unit 0 family inet6 set interfaces xe-0/0/1 unit 0 family inet6 set interfaces lo0 unit 0 family inet6 address 2001:db8:100::4/128 set policy-options as-list a-list members [65000-65100] set policy-options policy-statement DIRECT-RTS from protocol direct set policy-options policy-statement DIRECT-RTS then accept set policy-options policy-statement load-balancing-policy then load-balance per-packet set protocols router-advertisement interface xe-0/0/0 set protocols router-advertisement interface xe-0/0/1 set protocols bgp group auto-disc family inet6 unicast set protocols bgp group auto-disc export DIRECT-RTS set protocols bgp group auto-disc local-as 65004 set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery family inet6 ipv6-nd set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery interface xe-0/0/0 set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery interface xe-0/0/1 set protocols bgp group auto-disc peer-as-list a-list set protocols bgp group auto-disc multipath multiple-as set routing-options forwarding-table export load-balancing-policy set routing-options router-id 10.0.0.4
主干 1 的快速配置:
set system host-name spine1 set interfaces xe-0/0/0 unit 0 family inet set interfaces xe-0/0/1 unit 0 family inet set interfaces xe-0/0/0 unit 0 family inet6 set interfaces xe-0/0/1 unit 0 family inet6 set interfaces lo0 unit 0 family inet6 address 2001:db8:100::1/128 set policy-options as-list a-list members [65000-65100] set policy-options policy-statement DIRECT-RTS from protocol direct set policy-options policy-statement DIRECT-RTS then accept set policy-options policy-statement load-balancing-policy then load-balance per-packet set protocols router-advertisement interface xe-0/0/0 set protocols router-advertisement interface xe-0/0/1 set protocols bgp group auto-disc family inet6 unicast set protocols bgp group auto-disc export DIRECT-RTS set protocols bgp group auto-disc local-as 65001 set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery family inet6 ipv6-nd set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery interface xe-0/0/0 set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery interface xe-0/0/1 set protocols bgp group auto-disc peer-as-list a-list set protocols bgp group auto-disc multipath multiple-as set routing-options forwarding-table export load-balancing-policy set routing-options router-id 10.0.0.1
主干 2 的快速配置:
set system host-name spine2 set interfaces xe-0/0/0 unit 0 family inet set interfaces xe-0/0/1 unit 0 family inet set interfaces xe-0/0/0 unit 0 family inet6 set interfaces xe-0/0/1 unit 0 family inet6 set interfaces lo0 unit 0 family inet6 address 2001:db8:100::2/128 set policy-options as-list a-list members [65000-65100] set policy-options policy-statement DIRECT-RTS from protocol direct set policy-options policy-statement DIRECT-RTS then accept set policy-options policy-statement load-balancing-policy then load-balance per-packet set protocols router-advertisement interface xe-0/0/0 set protocols router-advertisement interface xe-0/0/1 set protocols bgp group auto-disc family inet6 unicast set protocols bgp group auto-disc export DIRECT-RTS set protocols bgp group auto-disc local-as 65002 set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery family inet6 ipv6-nd set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery interface xe-0/0/0 set protocols bgp group auto-disc dynamic-neighbor FABRIC peer-auto-discovery interface xe-0/0/1 set protocols bgp group auto-disc peer-as-list a-list set protocols bgp group auto-disc multipath multiple-as set routing-options forwarding-table export load-balancing-policy set routing-options router-id 10.0.0.2
请务必在所有设备上提交配置更改。祝贺您新的 IPv6 底层网络!
在添加 EVPN-VXLAN 叠加之前,服务器设备的配置才相关。在添加叠加之前,这些设备将隔离,无法对任何其他交换矩阵或服务器设备执行 ping 操作。添加叠加的一部分涉及将接入端口参数(如 VLAN ID 和标记与未标记)配置为与所连接的设备兼容。
现在,只要假设服务器设备配置了拓扑图所示的 IPv4 寻址,并且这些设备配置为未标记(接入接口)操作就够了。
在下一节中,我们将介绍如何验证 BGP 未编号底层的正确操作。