示例:使用虚拟网关配置 EVPN-VXLAN 边缘路由桥接交换矩阵
以太网 VPN (EVPN) 是一种控制平面技术,可将主机(物理 [裸机] 服务器和虚拟机 [VM])置于网络中的任意位置,并保持与相同逻辑第 2 层 (L2) 叠加网络的连接。虚拟可扩展 LAN (VXLAN) 是为 L2 叠加网络创建数据平面的隧道协议。
通常部署 EVPN-VXLAN 的物理底层网络是两层 IP 交换矩阵,其中包括主干和叶节点设备,如 图 1 所示。两层脊叶式交换矩阵称为 3 级 Clos。
此示例详细介绍了如何使用 3 级 Clos 交换矩阵部署边缘路由桥接 (ERB) 架构。在此设计中,主干设备(例如QFX10000交换机)仅在叶设备之间提供 IP 连接。在这种能力下,它们被称为精简主干,因为它们不需要 VXLAN 功能。叶设备(例如QFX5100交换机)提供与连接的工作负载的连接,并在 ERB 的情况下,在叠加网络中提供 L2 和第 3 层 (L3) VXLAN 功能。L2 网关提供在同一 VLAN 内的桥接,而 L3 网关则通过使用集成路由和桥接 (IRB) 接口处理 VLAN 之间(VLAN 间)之间的流量。
在此示例中,我们使用虚拟网关地址 (VGA) 配置 IRB 接口。有关在 IRB 上使用任播 IP 地址的 ERB 示例以及有关不同方法的更多信息,请参阅 示例:使用任播网关配置 EVPN-VXLAN 边缘路由桥接交换矩阵。
ERB 架构有时被称为“折叠”交换矩阵。这是因为,与 CEB 设计相比,L2 和 L3 VXLAN 网关功能被折叠成交换矩阵的单层(分叶)。
有关 EVPN-VXLAN 技术和受支持架构的背景信息,请参阅 EVPN 入门。
有关如何配置 EVPN-VXLAN 集中路由桥接 (CRB) 叠加的示例 ,请参阅示例:配置 EVPN-VXLAN 集中路由桥接结构。

从 Junos OS 版本 17.3R1 开始,QFX5110交换机可作为叶设备在 EVPN-VXLAN ERB 叠加网络中充当 L2 和 L3 VXLAN 网关。
本主题提供在 ERB 叠加中用作叶的 QFX 设备的配置示例。
要求
此示例使用以下硬件和软件组件:
-
两个设备可用作中转主干设备。
-
运行 Junos OS 17.3R1 或更高版本的四台设备,可作为叶设备并提供 L2 和 L3 VXLAN 网关功能。
-
使用运行 Junos OS 21.3R1 版的 QFX10002 交换机进行更新和重新验证
-
-
有关受支持平台的列表,请参阅 硬件摘要 。
概述和拓扑
在此示例中,服务提供商支持具有多个服务器的 ABC Corporation。服务器 A 和服务器 C 使用 VLAN 101 相互通信。服务器 B 和服务器 D 使用 L3 网关进行通信。要在 图 2 所示的 ERB 叠加中启用此通信,请在用作 L2 和 L3 VXLAN 网关或叶设备的交换机上配置 表 1 中的关键软件实体。

实体 |
叶 1、叶 2、叶 3 和叶 4 上的配置 |
---|---|
VLAN |
V101系列 第 102 版 V103版 |
VRF 实例 |
VRF101型 vrf102_103 |
IRB 接口 |
IRB.101 10.1.101.1/24(IRB IP 地址) 10.1.101.254(虚拟网关地址) |
IRB.102 10.1.102.1/24(IRB IP 地址) 10.1.102.254(虚拟网关地址) |
|
IRB.103 10.1.103.1/24(IRB IP 地址) 10.1.103.254(虚拟网关地址) |
如 表 1 所示,您可以在每个叶设备上为服务器 A 和服务器 C 配置 VLAN v101,为服务器 B 配置 VLAN v102,为服务器 D 配置 VLAN v103。要隔离 VLAN v101、v102 和 v103 的 L3 路由,请在每个叶设备上创建 VPN 路由和转发 (VRF) 实例 vrf102 和 vrf102_103。要在 VLAN 之间路由流量,请配置 IRB 接口 IRB.101、IRB.102 和 IRB.103。您还可以将 VRF 实例 vrf101 与 IRB 接口 IRB.101 相关联,并将 VRF 实例 vrf102_103与 IRB 接口 IRB.102 和 IRB. 103 相关联。
可将 IRB 接口 IRB.101、IRB.102 和 IRB. 103 配置为处理服务器 VLAN 间流量的默认 L3 网关。为此,在每个 IRB 接口配置中,您还包括一个虚拟网关地址 (VGA),用于将 IRB 接口配置为默认 L3 网关。此外,此示例假定每台服务器都配置为使用特定的默认网关。有关默认网关以及 VLAN 间流量如何在物理服务器之间流向 ERB 叠加网络中其他 VLAN 中的另一台物理服务器或虚拟机的更多信息,请参阅 使用默认第 3 层网关在 EVPN-VXLAN 叠加网络中路由流量。
为 IRB 接口配置 VGA 时,请记住 IRB IP 地址和 VGA 必须不同。
此外,我们还要求您在no-gateway-community
其中使用虚拟网关地址配置 IRB 接口的每个 EVPN 路由实例的[edit routing-instances EVPN-instance-name protocols evpn default-gateway]
层次结构级别配置选项。或者,您也可以在支持此级别配置的平台上,在[edit protocols evpn default-gateway]
层次结构级别全局配置该no-gateway-community
选项。有关使用no-gateway-community
选项的详细信息,请参阅 default-gateway。
如 表 1 所示,您可以为 VLAN v101 以及 VLAN v102 和 v103 配置单独的 VRF 路由实例。要在 VLAN v101、v102 和 v103 中启用主机之间的通信,此示例说明如何从 VRF101 的路由表导出单播路由,并将路由导入路由表以vrf102_103,反之亦然。此功能也称为路由泄漏。
快速配置
CLI 快速配置
要快速配置 Leaf1,请复制以下命令并将其粘贴到文本文件中。删除所有换行符并更改任何必要的详细信息,以便与您的网络配置匹配。然后将命令复制并粘贴到层 [edit]
级的 CLI 中。
set chassis aggregated-devices ethernet device-count 1 set interfaces xe-0/0/0 unit 0 family inet address 10.1.11.2/30 set interfaces xe-0/0/1 unit 0 family inet address 10.1.21.2/30 set interfaces xe-0/0/2 ether-options 802.3ad ae0 set interfaces ae0 esi 00:01:01:01:01:01:01:01:01:01 set interfaces ae0 esi all-active set interfaces ae0 aggregated-ether-options lacp active set interfaces ae0 aggregated-ether-options lacp system-id 00:01:01:01:01:01 set interfaces ae0 unit 0 family ethernet-switching interface-mode trunk set interfaces ae0 unit 0 family ethernet-switching vlan members v101 set interfaces irb unit 101 virtual-gateway-accept-data set interfaces irb unit 101 family inet address 10.1.101.1/24 virtual-gateway-address 10.1.101.254 set interfaces irb unit 102 virtual-gateway-accept-data set interfaces irb unit 102 family inet address 10.1.102.1/24 virtual-gateway-address 10.1.102.254 set interfaces irb unit 103 virtual-gateway-accept-data set interfaces irb unit 103 family inet address 10.1.103.1/24 virtual-gateway-address 10.1.103.254 set interfaces lo0 unit 0 family inet address 10.1.255.11/32 set policy-options policy-statement load-balancing-policy then load-balance per-packet set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 from route-filter 10.1.255.11/32 exact set policy-options policy-statement send-direct term 1 then accept set policy-options policy-statement vrf101_vrf_imp term 1 from community vrf102_103 set policy-options policy-statement vrf101_vrf_imp term 1 then accept set policy-options policy-statement vrf102_103_vrf_imp term 1 from community vrf101 set policy-options policy-statement vrf102_103_vrf_imp term 1 then accept set policy-options community vrf101 members target:1001:1 set policy-options community vrf102_103 members target:1023:1 set routing-instances vrf101 instance-type vrf set routing-instances vrf101 routing-options auto-export set routing-instances vrf101 interface irb.101 set routing-instances vrf101 route-distinguisher 10.1.255.11:101 set routing-instances vrf101 vrf-import vrf101_vrf_imp set routing-instances vrf101 vrf-target target:1001:1 set routing-instances vrf102_103 instance-type vrf set routing-instances vrf102_103 routing-options auto-export set routing-instances vrf102_103 interface irb.102 set routing-instances vrf102_103 interface irb.103 set routing-instances vrf102_103 route-distinguisher 10.1.255.11:123 set routing-instances vrf102_103 vrf-import vrf102_103_vrf_imp set routing-instances vrf102_103 vrf-target target:1023:1 set routing-options router-id 10.1.255.11 set routing-options autonomous-system 65011 set routing-options forwarding-table export load-balancing-policy set protocols bgp group underlay type external set protocols bgp group underlay export send-direct set protocols bgp group underlay multipath multiple-as set protocols bgp group underlay neighbor 10.1.11.1 peer-as 65001 set protocols bgp group underlay neighbor 10.1.21.1 peer-as 65002 set protocols bgp group overlay type external set protocols bgp group overlay multihop set protocols bgp group overlay local-address 10.1.255.11 set protocols bgp group overlay family evpn signaling set protocols bgp group overlay multipath multiple-as set protocols bgp group overlay neighbor 10.1.255.1 peer-as 65001 set protocols bgp group overlay neighbor 10.1.255.2 peer-as 65002 set protocols evpn encapsulation vxlan set protocols evpn default-gateway no-gateway-community set protocols evpn multicast-mode ingress-replication set protocols evpn vni-options vni 101 vrf-target target:101:1 set protocols evpn vni-options vni 102 vrf-target target:102:1 set protocols evpn vni-options vni 103 vrf-target target:103:1 set protocols evpn extended-vni-list all set switch-options vtep-source-interface lo0.0 set switch-options route-distinguisher 10.1.255.11:1 set switch-options vrf-target target:1:1 set switch-options vrf-target auto set vlans v101 vlan-id 101 set vlans v101 l3-interface irb.101 set vlans v101 vxlan vni 101 set vlans v102 vlan-id 102 set vlans v102 l3-interface irb.102 set vlans v102 vxlan vni 102 set vlans v103 vlan-id 103 set vlans v103 l3-interface irb.103 set vlans v103 vxlan vni 103
底层网络配置
CLI 快速配置
要在 Leaf1 上快速配置底层网络,请复制以下命令并将其粘贴到文本文件中。删除所有换行符并更改任何必要的详细信息,以便与您的网络配置匹配。然后将命令复制并粘贴到层 [edit]
级的 CLI 中。
set interfaces xe-0/0/0 unit 0 family inet address 10.1.11.2/30 set interfaces xe-0/0/1 unit 0 family inet address 10.1.21.2/30 set interfaces lo0 unit 0 family inet address 10.1.255.11/32 set policy-options policy-statement load-balancing-policy then load-balance per-packet set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 from route-filter 10.1.255.11/32 exact set policy-options policy-statement send-direct term 1 then accept set routing-options router-id 10.1.255.11 set routing-options autonomous-system 65011 set routing-options forwarding-table export load-balancing-policy set protocols bgp group underlay type external set protocols bgp group underlay export send-direct set protocols bgp group underlay multipath multiple-as set protocols bgp group underlay neighbor 10.1.11.1 peer-as 65001 set protocols bgp group underlay neighbor 10.1.21.1 peer-as 65002
配置底层网络
分步过程
要在 Leaf1 上配置底层网络,请执行以下作:
-
配置连接到主干设备的接口以及 Leaf1 上的环路接口。
user@leaf1# set interfaces xe-0/0/0 unit 0 family inet address 10.1.11.2/30 user@leaf1# set interfaces xe-0/0/1 unit 0 family inet address 10.1.21.2/30 user@leaf1# set interfaces lo0 unit 0 family inet address 10.1.255.11/32
-
配置路由器 ID 和自治系统编号,并为叶 1 应用负载平衡策略。我们将在后面的步骤中展示策略配置。
user@leaf1# set routing-options router-id 10.1.255.11 user@leaf1# set routing-options autonomous-system 65011 user@leaf1# set routing-options forwarding-table export load-balancing-policy
-
配置与两个主干设备对等的 EBGP 组。我们将在后面的步骤中显示播发 Leaf1 的环路地址的策略。
user@leaf1# set protocols bgp group underlay type external user@leaf1# set protocols bgp group underlay export send-direct user@leaf1# set protocols bgp group underlay multipath multiple-as user@leaf1# set protocols bgp group underlay neighbor 10.1.11.1 peer-as 65001 user@leaf1# set protocols bgp group underlay neighbor 10.1.21.1 peer-as 65002
-
配置策略以负载平衡并通告 Leaf1 的环路地址。
user@leaf1# set policy-options policy-statement load-balancing-policy then load-balance per-packet user@leaf1# set policy-options policy-statement send-direct term 1 from protocol direct user@leaf1# set policy-options policy-statement send-direct term 1 from route-filter 10.1.255.11/32 exact user@leaf1# set policy-options policy-statement send-direct term 1 then accept
EVPN-VXLAN 叠加网络配置
CLI 快速配置
要快速配置叠加网络,请复制以下命令并将其粘贴到文本文件中。删除所有换行符并更改任何必要的详细信息,以便与您的网络配置匹配。然后将命令复制并粘贴到层 [edit]
级的 CLI 中。
set protocols bgp group overlay type external set protocols bgp group overlay multihop set protocols bgp group overlay local-address 10.1.255.11 set protocols bgp group overlay family evpn signaling set protocols bgp group overlay multipath multiple-as set protocols bgp group overlay neighbor 10.1.255.1 peer-as 65001 set protocols bgp group overlay neighbor 10.1.255.2 peer-as 65002 set protocols evpn encapsulation vxlan set protocols evpn default-gateway no-gateway-community set protocols evpn multicast-mode ingress-replication set protocols evpn vni-options vni 101 vrf-target target:101:1 set protocols evpn vni-options vni 102 vrf-target target:102:1 set protocols evpn vni-options vni 103 vrf-target target:103:1 set protocols evpn extended-vni-list all set switch-options vtep-source-interface lo0.0 set switch-options route-distinguisher 10.1.255.11:1 set switch-options vrf-target target:1:1 set switch-options vrf-target auto
配置 EVPN-VXLAN 底层网络
分步过程
要在 Leaf1 上配置基本 EVPN-VXLAN 叠加网络,请执行以下作:
-
在 Leaf1 和主干设备之间配置基于 EBGP 的叠加,为 Leaf1 指定本地 IP 地址,并将 EVPN 信令网络层可达性信息 (NLRI) 包含在 BGP 组中。
user@leaf1# set protocols bgp group overlay type external user@leaf1# set protocols bgp group overlay multihop user@leaf1# set protocols bgp group overlay local-address 10.1.255.11 user@leaf1# set protocols bgp group overlay family evpn signaling user@leaf1# set protocols bgp group overlay multipath multiple-as user@leaf1# set protocols bgp group overlay neighbor 10.1.255.1 peer-as 65001 user@leaf1# set protocols bgp group overlay neighbor 10.1.255.2 peer-as 65002
注意:某些 IP 交换矩阵使用基于 IBGP 的 EVPN-VXLAN 叠加。有关使用 IBGP 进行叠加的 IP 交换矩阵的示例,请参阅 示例:配置 EVPN-VXLAN 集中路由的桥接交换矩阵。请注意,为叠加选择 EBGP 或 IBGP 不会影响交换矩阵架构。CRB 和 ERB 设计均支持任一类型的叠加。
-
为 EVPN 邻接方之间交换的数据包配置 VXLAN 封装。指定所有 VXLAN 网络标识符 (VNI) 都是虚拟路由和转发 (VRF) 实例的一部分。此外,指定在不使用扩展社区选项
default-gateway
的情况下播发 IRB 接口的 MAC 地址和对应默认网关的 MAC 地址。user@leaf1# set protocols evpn encapsulation vxlan user@leaf1# set protocols evpn default-gateway no-gateway-community user@leaf1# set protocols evpn multicast-mode ingress-replication user@leaf1# set protocols evpn vni-options vni 101 vrf-target target:101:1 user@leaf1# set protocols evpn vni-options vni 102 vrf-target target:102:1 user@leaf1# set protocols evpn vni-options vni 103 vrf-target target:103:1 user@leaf1# set protocols evpn extended-vni-list all
-
配置交换机选项,为 VRF 路由实例设置路由识别符和 VRF 目标,并将接口 lo0 与虚拟隧道端点 (VTEP) 相关联。
user@leaf1# set switch-options vtep-source-interface lo0.0 user@leaf1# set switch-options route-distinguisher 10.1.255.11:1 user@leaf1# set switch-options vrf-target target:1:1 user@leaf1# set switch-options vrf-target auto
客户配置文件配置
CLI 快速配置
要为服务器 A、服务器 B、服务器 C 和服务器 D 快速配置基本客户配置文件,请复制以下命令并将其粘贴到文本文件中。删除所有换行符并更改任何必要的详细信息,以便与您的网络配置匹配。然后将命令复制并粘贴到层 [edit]
级的 CLI 中。
set chassis aggregated-devices ethernet device-count 1 set interfaces xe-0/0/2 ether-options 802.3ad ae0 set interfaces ae0 esi 00:01:01:01:01:01:01:01:01:01 set interfaces ae0 esi all-active set interfaces ae0 aggregated-ether-options lacp active set interfaces ae0 aggregated-ether-options lacp system-id 00:01:01:01:01:01 set interfaces ae0 unit 0 family ethernet-switching interface-mode trunk set interfaces ae0 unit 0 family ethernet-switching vlan members v101 set interfaces irb unit 101 virtual-gateway-accept-data set interfaces irb unit 101 family inet address 10.1.101.1/24 virtual-gateway-address 10.1.101.254 set interfaces irb unit 102 virtual-gateway-accept-data set interfaces irb unit 102 family inet address 10.1.102.1/24 virtual-gateway-address 10.1.102.254 set interfaces irb unit 103 virtual-gateway-accept-data set interfaces irb unit 103 family inet address 10.1.103.1/24 virtual-gateway-address 10.1.103.254 set routing-instances vrf101 instance-type vrf set routing-instances vrf101 interface irb.101 set routing-instances vrf101 route-distinguisher 10.1.255.11:101 set routing-instances vrf101 vrf-target target:1001:1 set routing-instances vrf102_103 instance-type vrf set routing-instances vrf102_103 interface irb.102 set routing-instances vrf102_103 interface irb.103 set routing-instances vrf102_103 route-distinguisher 10.1.255.11:123 set routing-instances vrf102_103 vrf-target target:1023:1 set vlans v101 vlan-id 101 set vlans v101 l3-interface irb.101 set vlans v101 vxlan vni 101 set vlans v102 vlan-id 102 set vlans v102 l3-interface irb.102 set vlans v102 vxlan vni 102 set vlans v103 vlan-id 103 set vlans v103 l3-interface irb.103 set vlans v103 vxlan vni 103
配置客户配置文件
分步过程
要在 Leaf1 上配置基本客户配置文件,请执行以下作:
-
通过配置聚合以太网接口,为接口指定 ESI,并设置模式,使与两个叶设备的连接都处于活动状态,使服务器 A 能够与叶 1 和叶 2 多宿主。
user@leaf1# set chassis aggregated-devices ethernet device-count 1 user@leaf1# set interfaces xe-0/0/2 ether-options 802.3ad ae0 user@leaf1# set interfaces ae0 esi 00:01:01:01:01:01:01:01:01:01 user@leaf1# set interfaces ae0 esi all-active user@leaf1# set interfaces ae0 aggregated-ether-options lacp active user@leaf1# set interfaces ae0 aggregated-ether-options lacp system-id 00:01:01:01:01:01 user@leaf1# set interfaces ae0 unit 0 family ethernet-switching interface-mode trunk user@leaf1# set interfaces ae0 unit 0 family ethernet-switching vlan members v101
注意:在 Leaf2 上配置 ae0 接口时,必须指定与在 Leaf1 上的相同接口指定的相同 ESI (00:01:01:01:01:01:01:01:01:01:01)。
-
配置 IRB 接口和关联的 VGA(默认 L3 虚拟网关),以支持不同 VLAN 中的服务器之间的通信。添加可选配置
virtual-gateway-accept-data
以允许 VGA 响应 ping 数据包。user@leaf1# set interfaces irb unit 101 virtual-gateway-accept-data user@leaf1# set interfaces irb unit 101 family inet address 10.1.101.1/24 virtual-gateway-address 10.1.101.254 user@leaf1# set interfaces irb unit 102 virtual-gateway-accept-data user@leaf1# set interfaces irb unit 102 family inet address 10.1.102.1/24 virtual-gateway-address 10.1.102.254 user@leaf1# set interfaces irb unit 103 virtual-gateway-accept-data user@leaf1# set interfaces irb unit 103 family inet address 10.1.103.1/24 virtual-gateway-address 10.1.103.254
注意:为 IRB 接口配置 VGA 时,请记住 IRB IP 地址和 VGA 必须不同。
-
为 VLAN v101 配置一个 VRF 路由实例,为 VLAN v102 和 v103 配置另一个 VRF 路由实例。在每个路由实例中,关联 IRB 接口 a
route-distinguisher
和 。vrf-target
user@leaf1# set routing-instances vrf101 instance-type vrf user@leaf1# set routing-instances vrf101 interface irb.101 user@leaf1# set routing-instances vrf101 route-distinguisher 10.1.255.11:101 user@leaf1# set routing-instances vrf101 vrf-target target:1001:1 user@leaf1# set routing-instances vrf102_103 instance-type vrf user@leaf1# set routing-instances vrf102_103 interface irb.102 user@leaf1# set routing-instances vrf102_103 interface irb.103 user@leaf1# set routing-instances vrf102_103 route-distinguisher 10.1.255.11:123 user@leaf1# set routing-instances vrf102_103 vrf-target target:1023:1
-
配置 VLAN v101、v102 和 v103,并将一个 IRB 接口和 VNI 与每个 VLAN 相关联。
user@leaf1# set vlans v101 vlan-id 101 user@leaf1# set vlans v101 l3-interface irb.101 user@leaf1# set vlans v101 vxlan vni 101 user@leaf1# set vlans v102 vlan-id 102 user@leaf1# set vlans v102 l3-interface irb.102 user@leaf1# set vlans v102 vxlan vni 102 user@leaf1# set vlans v103 vlan-id 103 user@leaf1# set vlans v103 l3-interface irb.103 user@leaf1# set vlans v103 vxlan vni 103
路由泄漏配置
此时,根据配置,服务器 A 和服务器 C 应该能够相互访问。服务器 B 和服务器 D 应该能够相互访问。为了使所有服务器都能够相互访问,我们在路由实例之间泄露路由。
CLI 快速配置
要快速配置路由泄漏,请复制以下命令并将其粘贴到文本文件中。删除所有换行符并更改任何必要的详细信息,以便与您的网络配置匹配。然后将命令复制并粘贴到层 [edit]
级的 CLI 中。
set policy-options policy-statement vrf101_vrf_imp term 1 from community vrf102_103 set policy-options policy-statement vrf101_vrf_imp term 1 then accept set policy-options policy-statement vrf102_103_vrf_imp term 1 from community vrf101 set policy-options policy-statement vrf102_103_vrf_imp term 1 then accept set policy-options community vrf101 members target:1001:1 set policy-options community vrf102_103 members target:1023:1 set routing-instances vrf101 routing-options auto-export set routing-instances vrf101 vrf-import vrf101_vrf_imp set routing-instances vrf102_103 routing-options auto-export set routing-instances vrf102_103 vrf-import vrf102_103_vrf_imp
配置路由泄漏
分步过程
要在 Leaf1 上配置路由泄漏:
-
配置与您为路由实例配置的目标匹配的社区。配置在每个路由实例下应用的策略,该策略与另一个
routing-instance
路由实例匹配vrf-target
。user@leaf1# set policy-options policy-statement vrf101_vrf_imp term 1 from community vrf102_103 user@leaf1# set policy-options policy-statement vrf101_vrf_imp term 1 then accept user@leaf1# set policy-options policy-statement vrf102_103_vrf_imp term 1 from community vrf101 user@leaf1# set policy-options policy-statement vrf102_103_vrf_imp term 1 then accept user@leaf1# set policy-options community vrf101 members target:1001:1 user@leaf1# set policy-options community vrf102_103 members target:1023:1
-
在 VRF 路由实例中,应用在上一步中配置的路由策略。这将在路由实例之间建立公共路由目标。
user@leaf1# set routing-instances vrf101 vrf-import vrf101_vrf_imp user@leaf1# set routing-instances vrf102_103 vrf-import vrf102_103_vrf_imp
-
配置
auto-export
允许在具有通用路由目标的实例之间共享路由的选项。user@leaf1# set routing-instances vrf101 routing-options auto-export user@leaf1# set routing-instances vrf102_103 routing-options auto-export
验证
本节介绍了此示例的以下验证:
验证 BGP
目的
验证主干设备是否已建立 BGP 会话连接。
行动
显示 BGP 摘要:
user@leaf1> show bgp summary Threading mode: BGP I/O Default eBGP mode: advertise - accept, receive - accept Groups: 2 Peers: 4 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending bgp.evpn.0 130 65 0 0 0 0 inet.0 8 8 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 10.1.11.1 65001 31797 32161 0 0 1w3d 3:51:49 Establ inet.0: 4/4/4/0 10.1.21.1 65002 31794 32164 0 0 1w3d 3:51:48 Establ inet.0: 4/4/4/0 10.1.255.1 65001 32506 32631 0 0 1w3d 3:51:47 Establ bgp.evpn.0: 40/65/65/0 default-switch.evpn.0: 44/64/64/0 __default_evpn__.evpn.0: 0/1/1/0 10.1.255.2 65002 32530 32624 0 0 1w3d 3:51:43 Establ bgp.evpn.0: 25/65/65/0 default-switch.evpn.0: 20/64/64/0 __default_evpn__.evpn.0: 1/1/1/0
意义
底层和叠加 BGP 会话都是使用主干设备建立的。
验证 ESI
目的
验证 ESI 的状态。
行动
显示 ESI 的状态:
user@leaf1> show evpn instance esi 00:01:01:01:01:01:01:01:01:01 extensive Instance: default-switch Route Distinguisher: 10.1.255.11:1 Encapsulation type: VXLAN Duplicate MAC detection threshold: 5 Duplicate MAC detection window: 180 MAC database status Local Remote MAC advertisements: 4 22 MAC+IP advertisements: 7 22 Default gateway MAC advertisements: 6 0 Number of local interfaces: 2 (2 up) Interface name ESI Mode Status AC-Role .local..6 00:00:00:00:00:00:00:00:00:00 single-homed Up Root ae0.0 00:01:01:01:01:01:01:01:01:01 all-active Up Root Number of IRB interfaces: 3 (3 up) Interface name VLAN VNI Status L3 context irb.101 101 Up vrf101 irb.102 102 Up vrf102_103 irb.103 103 Up vrf102_103 Number of protect interfaces: 0 Number of bridge domains: 3 VLAN Domain-ID Intfs/up IRB-intf Mode MAC-sync IM-label MAC-label v4-SG-sync IM-core-NH v6-SG-sync IM-core-NH Trans-ID 101 101 1 1 irb.101 Extended Enabled 101 Disabled Disabled 101 102 102 0 0 irb.102 Extended Enabled 102 Disabled Disabled 102 103 103 0 0 irb.103 Extended Enabled 103 Disabled Disabled 103 Number of neighbors: 3 Address MAC MAC+IP AD IM ES Leaf-label Remote-DCI-Peer 10.1.255.12 8 8 5 3 0 10.1.255.13 7 7 3 3 0 10.1.255.14 7 7 3 3 0 Number of ethernet segments: 13 ESI: 00:01:01:01:01:01:01:01:01:01 Status: Resolved by IFL ae0.0 Local interface: ae0.0, Status: Up/Forwarding Number of remote PEs connected: 1 Remote-PE MAC-label Aliasing-label Mode 10.1.255.12 101 0 all-active DF Election Algorithm: MOD based Designated forwarder: 10.1.255.12 Backup forwarder: 10.1.255.11 Last designated forwarder update: Jun 02 12:46:14 Router-ID: 10.1.255.11 Source VTEP interface IP: 10.1.255.11 SMET Forwarding: Disabled
意义
ESI 已启动,Leaf2 是远程提供商边缘 (PE) 设备和指定的转发器。
验证 EVPN 数据库
目的
验证 EVPN 数据库中的 MAC 地址。
行动
验证 EVPN 数据库中 VLAN 101 的 MAC 地址。
user@leaf1> show evpn database l2-domain-id 101 Instance: default-switch VLAN DomainId MAC address Active source Timestamp IP address 101 00:00:5e:00:01:01 05:00:00:fd:f3:00:00:00:65:00 May 23 11:58:57 10.1.101.254 101 02:05:86:11:af:00 10.1.255.14 May 26 12:49:49 10.1.101.4 101 02:05:86:54:14:00 10.1.255.13 May 23 12:04:41 10.1.101.3 101 02:05:86:8d:d9:00 irb.101 May 23 11:58:57 10.1.101.1 101 02:05:86:c2:39:00 10.1.255.12 May 23 11:58:58 10.1.101.2 101 2c:6b:f5:01:b1:c0 00:01:01:01:01:01:01:01:01:01 Jun 02 12:46:21 10.1.101.101 101 56:04:15:00:dc:95 10.1.255.13 May 23 12:07:33 10.1.101.103
意义
服务器 A 的 MAC 和 IP 地址随 ESI 的活动源一起显示,服务器 C 的 MAC 和 IP 地址随叶 3 的活动源一起显示。此外,还会显示 VGA 的 MAC 和每个叶式 IRB 接口。
验证连接性
目的
验证 ping 在服务器之间是否有效。
行动
从服务器 A 到其他服务器的 Ping。
user@serverA> ping 10.1.102.101 count 2 PING 10.1.102.101 (10.1.102.101): 56 data bytes 64 bytes from 10.1.102.101: icmp_seq=0 ttl=63 time=117.425 ms 64 bytes from 10.1.102.101: icmp_seq=1 ttl=63 time=109.663 ms --- 10.1.102.101 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 109.663/113.544/117.425/3.881 ms user@serverA> ping 10.1.101.103 count 2 PING 10.1.101.103 (10.1.101.103): 56 data bytes 64 bytes from 10.1.101.103: icmp_seq=0 ttl=64 time=311.050 ms 64 bytes from 10.1.101.103: icmp_seq=1 ttl=64 time=201.300 ms --- 10.1.101.103 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 201.300/256.175/311.050/54.875 ms user@serverA> ping 10.1.103.101 count 2 PING 10.1.103.101 (10.1.103.101): 56 data bytes 64 bytes from 10.1.103.101: icmp_seq=0 ttl=63 time=311.321 ms 64 bytes from 10.1.103.101: icmp_seq=1 ttl=63 time=367.343 ms --- 10.1.103.101 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 311.321/339.332/367.343/28.011 ms
意义
端到端连接正常工作。
所有设备的快速配置
CLI 快速配置
要快速配置此示例,请复制以下命令并将其粘贴到文本文件中。删除所有换行符并更改任何必要的详细信息,以便与您的网络配置匹配。然后将命令复制并粘贴到层 [edit]
级的 CLI 中。
枝叶 2
set chassis aggregated-devices ethernet device-count 1 set interfaces xe-0/0/0 unit 0 family inet address 10.1.12.2/30 set interfaces xe-0/0/1 unit 0 family inet address 10.1.22.2/30 set interfaces xe-0/0/2 ether-options 802.3ad ae0 set interfaces xe-0/0/3 unit 0 family ethernet-switching interface-mode trunk set interfaces xe-0/0/3 unit 0 family ethernet-switching vlan members v102 set interfaces ae0 esi 00:01:01:01:01:01:01:01:01:01 set interfaces ae0 esi all-active set interfaces ae0 aggregated-ether-options lacp active set interfaces ae0 aggregated-ether-options lacp system-id 00:01:01:01:01:01 set interfaces ae0 unit 0 family ethernet-switching interface-mode trunk set interfaces ae0 unit 0 family ethernet-switching vlan members v101 set interfaces irb unit 101 virtual-gateway-accept-data set interfaces irb unit 101 family inet address 10.1.101.2/24 virtual-gateway-address 10.1.101.254 set interfaces irb unit 102 virtual-gateway-accept-data set interfaces irb unit 102 family inet address 10.1.102.2/24 virtual-gateway-address 10.1.102.254 set interfaces irb unit 103 virtual-gateway-accept-data set interfaces irb unit 103 family inet address 10.1.103.2/24 virtual-gateway-address 10.1.103.254 set interfaces lo0 unit 0 family inet address 10.1.255.12/32 set policy-options policy-statement load-balancing-policy then load-balance per-packet set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 from route-filter 10.1.255.12/32 exact set policy-options policy-statement send-direct term 1 from route-filter 10.1.255.11/32 exact set policy-options policy-statement send-direct term 1 then accept set policy-options policy-statement vrf101_vrf_imp term 1 from community vrf102_103 set policy-options policy-statement vrf101_vrf_imp term 1 then accept set policy-options policy-statement vrf102_103_vrf_imp term 1 from community vrf101 set policy-options policy-statement vrf102_103_vrf_imp term 1 then accept set policy-options community vrf101 members target:1001:1 set policy-options community vrf102_103 members target:1023:1 set routing-instances vrf101 instance-type vrf set routing-instances vrf101 routing-options auto-export set routing-instances vrf101 interface irb.101 set routing-instances vrf101 route-distinguisher 10.1.255.12:101 set routing-instances vrf101 vrf-import vrf101_vrf_imp set routing-instances vrf101 vrf-target target:1001:1 set routing-instances vrf102_103 instance-type vrf set routing-instances vrf102_103 routing-options auto-export set routing-instances vrf102_103 interface irb.102 set routing-instances vrf102_103 interface irb.103 set routing-instances vrf102_103 route-distinguisher 10.1.255.12:123 set routing-instances vrf102_103 vrf-import vrf102_103_vrf_imp set routing-instances vrf102_103 vrf-target target:1023:1 set routing-options router-id 10.1.255.12 set routing-options autonomous-system 65012 set routing-options forwarding-table export load-balancing-policy set protocols bgp group underlay type external set protocols bgp group underlay export send-direct set protocols bgp group underlay multipath multiple-as set protocols bgp group underlay neighbor 10.1.12.1 peer-as 65001 set protocols bgp group underlay neighbor 10.1.22.1 peer-as 65002 set protocols bgp group overlay type external set protocols bgp group overlay multihop set protocols bgp group overlay local-address 10.1.255.12 set protocols bgp group overlay family evpn signaling set protocols bgp group overlay multipath multiple-as set protocols bgp group overlay neighbor 10.1.255.1 peer-as 65001 set protocols bgp group overlay neighbor 10.1.255.2 peer-as 65002 set protocols evpn encapsulation vxlan set protocols evpn default-gateway no-gateway-community set protocols evpn multicast-mode ingress-replication set protocols evpn vni-options vni 101 vrf-target target:101:1 set protocols evpn vni-options vni 102 vrf-target target:102:1 set protocols evpn vni-options vni 103 vrf-target target:103:1 set protocols evpn extended-vni-list all set switch-options vtep-source-interface lo0.0 set switch-options route-distinguisher 10.1.255.12:1 set switch-options vrf-target target:1:1 set switch-options vrf-target auto set vlans v101 vlan-id 101 set vlans v101 l3-interface irb.101 set vlans v101 vxlan vni 101 set vlans v102 vlan-id 102 set vlans v102 l3-interface irb.102 set vlans v102 vxlan vni 102 set vlans v103 vlan-id 103 set vlans v103 l3-interface irb.103 set vlans v103 vxlan vni 103
枝叶 3
set interfaces xe-0/0/0 unit 0 family inet address 10.1.13.2/30 set interfaces xe-0/0/1 unit 0 family inet address 10.1.23.2/30 set interfaces xe-0/0/2 unit 0 family ethernet-switching interface-mode trunk set interfaces xe-0/0/2 unit 0 family ethernet-switching vlan members v101 set interfaces irb unit 101 virtual-gateway-accept-data set interfaces irb unit 101 family inet address 10.1.101.3/24 virtual-gateway-address 10.1.101.254 set interfaces irb unit 102 virtual-gateway-accept-data set interfaces irb unit 102 family inet address 10.1.102.3/24 virtual-gateway-address 10.1.102.254 set interfaces irb unit 103 virtual-gateway-accept-data set interfaces irb unit 103 family inet address 10.1.103.3/24 virtual-gateway-address 10.1.103.254 set interfaces lo0 unit 0 family inet address 10.1.255.13/32 set policy-options policy-statement load-balancing-policy then load-balance per-packet set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 from route-filter 10.1.255.13/32 exact set policy-options policy-statement send-direct term 1 then accept set policy-options policy-statement vrf101_vrf_imp term 1 from community vrf102_103 set policy-options policy-statement vrf101_vrf_imp term 1 then accept set policy-options policy-statement vrf102_103_vrf_imp term 1 from community vrf101 set policy-options policy-statement vrf102_103_vrf_imp term 1 then accept set policy-options community vrf101 members target:1001:1 set policy-options community vrf102_103 members target:1023:1 set routing-instances vrf101 instance-type vrf set routing-instances vrf101 routing-options auto-export set routing-instances vrf101 interface irb.101 set routing-instances vrf101 route-distinguisher 10.1.255.13:101 set routing-instances vrf101 vrf-import vrf101_vrf_imp set routing-instances vrf101 vrf-target target:1001:1 set routing-instances vrf102_103 instance-type vrf set routing-instances vrf102_103 routing-options auto-export set routing-instances vrf102_103 interface irb.102 set routing-instances vrf102_103 interface irb.103 set routing-instances vrf102_103 route-distinguisher 10.1.255.13:123 set routing-instances vrf102_103 vrf-import vrf102_103_vrf_imp set routing-instances vrf102_103 vrf-target target:1023:1 set routing-options router-id 10.1.255.13 set routing-options autonomous-system 65013 set routing-options forwarding-table export load-balancing-policy set protocols bgp group underlay type external set protocols bgp group underlay export send-direct set protocols bgp group underlay multipath multiple-as set protocols bgp group underlay neighbor 10.1.13.1 peer-as 65001 set protocols bgp group underlay neighbor 10.1.23.1 peer-as 65002 set protocols bgp group overlay type external set protocols bgp group overlay multihop set protocols bgp group overlay local-address 10.1.255.13 set protocols bgp group overlay family evpn signaling set protocols bgp group overlay multipath multiple-as set protocols bgp group overlay neighbor 10.1.255.1 peer-as 65001 set protocols bgp group overlay neighbor 10.1.255.2 peer-as 65002 set protocols evpn encapsulation vxlan set protocols evpn default-gateway no-gateway-community set protocols evpn multicast-mode ingress-replication set protocols evpn vni-options vni 101 vrf-target target:101:1 set protocols evpn vni-options vni 102 vrf-target target:102:1 set protocols evpn vni-options vni 103 vrf-target target:103:1 set protocols evpn extended-vni-list all set switch-options vtep-source-interface lo0.0 set switch-options route-distinguisher 10.1.255.13:1 set switch-options vrf-target target:1:1 set switch-options vrf-target auto set vlans v101 vlan-id 101 set vlans v101 l3-interface irb.101 set vlans v101 vxlan vni 101 set vlans v102 vlan-id 102 set vlans v102 l3-interface irb.102 set vlans v102 vxlan vni 102 set vlans v103 vlan-id 103 set vlans v103 l3-interface irb.103 set vlans v103 vxlan vni 103
枝叶 4
set interfaces xe-0/0/0 unit 0 family inet address 10.1.14.2/30 set interfaces xe-0/0/1 unit 0 family inet address 10.1.24.2/30 set interfaces xe-0/0/2 unit 0 family ethernet-switching interface-mode trunk set interfaces xe-0/0/2 unit 0 family ethernet-switching vlan members v103 set interfaces irb unit 101 virtual-gateway-accept-data set interfaces irb unit 101 family inet address 10.1.101.4/24 virtual-gateway-address 10.1.101.254 set interfaces irb unit 102 virtual-gateway-accept-data set interfaces irb unit 102 family inet address 10.1.102.4/24 virtual-gateway-address 10.1.102.254 set interfaces irb unit 103 virtual-gateway-accept-data set interfaces irb unit 103 family inet address 10.1.103.4/24 virtual-gateway-address 10.1.103.254 set interfaces lo0 unit 0 family inet address 10.1.255.14/32 set policy-options policy-statement load-balancing-policy then load-balance per-packet set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 from route-filter 10.1.255.14/32 exact set policy-options policy-statement send-direct term 1 then accept set policy-options policy-statement vrf101_vrf_imp term 1 from community vrf102_103 set policy-options policy-statement vrf101_vrf_imp term 1 then accept set policy-options policy-statement vrf102_103_vrf_imp term 1 from community vrf101 set policy-options policy-statement vrf102_103_vrf_imp term 1 then accept set policy-options community vrf101 members target:1001:1 set policy-options community vrf102_103 members target:1023:1 set routing-instances vrf101 instance-type vrf set routing-instances vrf101 routing-options auto-export set routing-instances vrf101 interface irb.101 set routing-instances vrf101 route-distinguisher 10.1.255.14:101 set routing-instances vrf101 vrf-import vrf101_vrf_imp set routing-instances vrf101 vrf-target target:1001:1 set routing-instances vrf102_103 instance-type vrf set routing-instances vrf102_103 routing-options auto-export set routing-instances vrf102_103 interface irb.102 set routing-instances vrf102_103 interface irb.103 set routing-instances vrf102_103 route-distinguisher 10.1.255.14:123 set routing-instances vrf102_103 vrf-import vrf102_103_vrf_imp set routing-instances vrf102_103 vrf-target target:1023:1 set routing-options router-id 10.1.255.14 set routing-options autonomous-system 65014 set routing-options forwarding-table export load-balancing-policy set protocols bgp group underlay type external set protocols bgp group underlay export send-direct set protocols bgp group underlay multipath multiple-as set protocols bgp group underlay neighbor 10.1.14.1 peer-as 65001 set protocols bgp group underlay neighbor 10.1.24.1 peer-as 65002 set protocols bgp group overlay type external set protocols bgp group overlay multihop set protocols bgp group overlay local-address 10.1.255.14 set protocols bgp group overlay family evpn signaling set protocols bgp group overlay multipath multiple-as set protocols bgp group overlay neighbor 10.1.255.1 peer-as 65001 set protocols bgp group overlay neighbor 10.1.255.2 peer-as 65002 set protocols evpn encapsulation vxlan set protocols evpn default-gateway no-gateway-community set protocols evpn multicast-mode ingress-replication set protocols evpn vni-options vni 101 vrf-target target:101:1 set protocols evpn vni-options vni 102 vrf-target target:102:1 set protocols evpn vni-options vni 103 vrf-target target:103:1 set protocols evpn extended-vni-list all set switch-options vtep-source-interface lo0.0 set switch-options route-distinguisher 10.1.255.14:1 set switch-options vrf-target target:1:1 set vlans v101 vlan-id 101 set vlans v101 l3-interface irb.101 set vlans v101 vxlan vni 101 set vlans v102 vlan-id 102 set vlans v102 l3-interface irb.102 set vlans v102 vxlan vni 102 set vlans v103 vlan-id 103 set vlans v103 l3-interface irb.103 set vlans v103 vxlan vni 103
主干 1
set interfaces xe-0/0/0 unit 0 family inet address 10.1.11.1/30 set interfaces xe-0/0/1 unit 0 family inet address 10.1.12.1/30 set interfaces xe-0/0/2 unit 0 family inet address 10.1.13.1/30 set interfaces xe-0/0/3 unit 0 family inet address 10.1.14.1/30 set interfaces lo0 unit 0 family inet address 10.1.255.1/32 set policy-options policy-statement load-balancing-policy then load-balance per-packet set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 from route-filter 10.1.255.1/32 exact set policy-options policy-statement send-direct term 1 then accept set routing-options router-id 10.1.255.1 set routing-options autonomous-system 65001 set routing-options forwarding-table export load-balancing-policy set protocols bgp group underlay type external set protocols bgp group underlay export send-direct set protocols bgp group underlay multipath multiple-as set protocols bgp group underlay neighbor 10.1.11.2 peer-as 65011 set protocols bgp group underlay neighbor 10.1.12.2 peer-as 65012 set protocols bgp group underlay neighbor 10.1.13.2 peer-as 65013 set protocols bgp group underlay neighbor 10.1.14.2 peer-as 65014 set protocols bgp group overlay type external set protocols bgp group overlay multihop no-nexthop-change set protocols bgp group overlay local-address 10.1.255.1 set protocols bgp group overlay family evpn signaling set protocols bgp group overlay multipath multiple-as set protocols bgp group overlay neighbor 10.1.255.11 peer-as 65011 set protocols bgp group overlay neighbor 10.1.255.12 peer-as 65012 set protocols bgp group overlay neighbor 10.1.255.13 peer-as 65013 set protocols bgp group overlay neighbor 10.1.255.14 peer-as 65014 set protocols bgp group overlay neighbor 10.1.255.2 peer-as 65002
主干 2
set interfaces xe-0/0/0 unit 0 family inet address 10.1.21.1/30 set interfaces xe-0/0/1 unit 0 family inet address 10.1.22.1/30 set interfaces xe-0/0/2 unit 0 family inet address 10.1.23.1/30 set interfaces xe-0/0/3 unit 0 family inet address 10.1.24.1/30 set interfaces lo0 unit 0 family inet address 10.1.255.2/32 set policy-options policy-statement load-balancing-policy then load-balance per-packet set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 from route-filter 10.1.255.2/32 exact set policy-options policy-statement send-direct term 1 then accept set routing-options router-id 10.1.255.2 set routing-options autonomous-system 65002 set routing-options forwarding-table export load-balancing-policy set protocols bgp group underlay type external set protocols bgp group underlay export send-direct set protocols bgp group underlay multipath multiple-as set protocols bgp group underlay neighbor 10.1.21.2 peer-as 65011 set protocols bgp group underlay neighbor 10.1.22.2 peer-as 65012 set protocols bgp group underlay neighbor 10.1.23.2 peer-as 65013 set protocols bgp group underlay neighbor 10.1.24.2 peer-as 65014 set protocols bgp group overlay type external set protocols bgp group overlay multihop no-nexthop-change set protocols bgp group overlay local-address 10.1.255.2 set protocols bgp group overlay family evpn signaling set protocols bgp group overlay multipath multiple-as set protocols bgp group overlay neighbor 10.1.255.11 peer-as 65011 set protocols bgp group overlay neighbor 10.1.255.12 peer-as 65012 set protocols bgp group overlay neighbor 10.1.255.13 peer-as 65013 set protocols bgp group overlay neighbor 10.1.255.14 peer-as 65014 set protocols bgp group overlay neighbor 10.1.255.1 peer-as 65001
变更历史表
是否支持某项功能取决于您使用的平台和版本。使用 功能浏览器 查看您使用的平台是否支持某项功能。