在 L2VPN 中配置任播网关
将单个 IP 地址配置为在 L2VPN 内的多个设备上充当任播网关。
任播是一种网络功能,您可以在其中为网络中的多个设备分配相同的 IP 地址。任播使设备能够使用与传入流量的默认网关相同的 IP 地址。任播的优势包括冗余连接和提高网络弹性。
在 MPLS 网络中,PE 设备通常会动态分配唯一的内部 VPN 标签来识别不同的 VPN。外部标签用于在服务提供商的核心网络中转发数据包,而内部 VPN 标签则用于识别特定的客户 VPN。当有多台设备共享网关的 IP 地址时,动态标签分配可能会导致 VPN 标签不一致。这会导致路由表中出现重复条目,导致网络效率低下。从 Junos OS 25.4R1 版开始,我们支持为每个 VPN 站点添加静态标签。
图 1 展示了具有任播 IP 地址的 L2VPN 拓扑。PE 设备(PE3 和 PE4)具有不同的 BGP 协议环路地址,但共享任播网关的 IP 地址。下面介绍了在 PE3 上配置任播地址的示例配置。对 PE4 使用类似的配置。
图 1:L2VPN
中的任播网关
中的任播网关
使用此 show l2vpn connections 命令验证是否正在应用标签。
regress@PE1_re> show l2vpn connections
Instance: L2VPN1
Edge protection: Not-Primary
Local site: CE2 (10)
connection-site Type St Time last up # Up trans
11 rmt Up Apr 9 13:51:11 2025 1
Remote PE: 172.16.7.7, Negotiated control-word: Yes (Null)
Incoming label: 800000, Outgoing label: 800009
Local interface: et-0/0/0.1, Status: Up, Encapsulation: VLAN
Flow Label Transmit: No, Flow Label Receive: No
regress@PE1_re> show route table mpls.0
mpls.0: 13 destinations, 15 routes (13 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
800000 [L2VPN/7] 23:46:00
> via et-0/0/0.1, Pop Offset: 4.
et-0/0/0.1 *[L2VPN/7] 23:46:00, metric2 1
> to 2.0.0.1 via et-0/0/0.0, Push 800009, Push 299792(top) Offset: 252