示例:VPLS 多宿主,改善融合时间
此示例说明如何配置对客户站点采用多宿主的虚拟专用 LAN 服务 (VPLS)。此特定 VPLS 多宿主示例展示了在多宿主站点需要将流量切换至其备用 PE 路由器时,如何配置可缩短网络融合时间的功能。
要求
此示例使用以下硬件和软件组件:
三个 M 系列、MX 系列或 T 系列路由器
Junos OS 12.2 或更高版本
如果您使用 M 系列或 T 系列路由器,PE 路由器必须具有虚拟环路隧道 (vt
) 接口或标签交换接口 (LSI)。在 M 系列和 T 系列路由器上,VPLS 使用基于隧道的 PIC 在 vt 接口上创建虚拟端口。如果您的 M 系列或 T 系列路由器上未安装基于隧道的 PIC,您仍然可以使用 LSI 来支持虚拟端口来配置 VPLS。使用 LSI 需要安装在增强型灵活 PIC 集中器 (FPC) 中的基于以太网的 PIC。
无需将路由器用于 CE 设备。例如,CE 设备可以是 EX 系列以太网交换机。
概述
VPLS 网络中的所有 PE 路由器都像大型分布式以太网交换机一样运行,为连接的设备提供第 2 层服务。此示例说明了配置为使用 VPLS 多宿主的 PE 路由器和 CE 设备网络。该拓扑由六个路由器组成:四个 PE 路由器和两个 CE 设备。设备 CE1 多宿主路由器 PE1 和 PE2。PE 路由器配置 best-site
了 and mac-flush
语句,以在设备 CE1 与其一个多宿主 PE 路由器之间的连接出现故障时缩短融合时间。
此示例包含以下设置:
best-site
-在第 2 层信息扩展社区中使用控制标记位向量(从最有量位开始的第三位计数)的 B 位,以指示首选站点。配置的每个 VPLS 站点都会向best-site
其他 PE 路由器发送语句信号,将其发送为首选站点。第 2 层信息扩展社区包括以下信息:扩展社区类型(2 个八位位位组)
封装类型(1 个八位位)
控制标志(1 个八位位位)
2 层 MTU(2 个八位位位组)
保留(2 个八位位位组)
当 VPLS 路由实例中的相邻 PE 路由器收到标签块播发时,它知道相应的 PE 路由器是那些与该站点多宿主的远程 PE 路由器最可取的路由器。如果相邻 PE 路由器不支持最佳站点功能,则使用标准本地站点选择流程。例如,如果路由器 PE1 未从从路由器 PE3 接收的任何标签块播发接收的 B 位,路由器 PE1 会继续假设路由器 PE3 不支持最佳站点功能。它会根据其最小指定站点创建虚拟电路。对于支持最佳站点功能的其他 PE 路由器,路由器 PE1 使用本地标记的最佳站点构建虚拟电路。
mac-flush
—对 VPLS 路由实例或 VPLS 路由实例下的网格组启用媒体访问控制 (MAC) 刷新处理。MAC 刷新处理将从动态学习的 MAC 地址数据库中移除 MAC 地址。移除动态学习的 MAC 地址后,MAC 地址融合所需的时间更少。
拓扑
图 1 显示了此示例中使用的拓扑。路由器 PE2 配置了 best-site
语句,并用作来自设备 CE1 的流量的首选网关。

配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
路由器 PE1:
set interfaces fe-0/1/0 encapsulation ethernet-vpls set interfaces fe-0/1/0 unit 0 family vpls set interfaces fe-0/1/2 unit 0 family inet address 10.0.59.14/32 set interfaces fe-0/1/2 unit 0 family iso set interfaces fe-0/1/2 unit 0 family mpls set interfaces fe-0/1/3 unit 0 family inet address 10.0.89.14/30 set interfaces fe-0/1/3 unit 0 family iso set interfaces fe-0/1/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.9.1/32 set interfaces lo0 unit 0 family iso address 47.0005.8083.0000.1921.6800.5003.00 set routing-options router-id 192.168.9.1 set protocols mpls interface all set protocols bgp group int type internal set protocols bgp group int local-address 192.0.2.1 set protocols bgp group int family l2vpn signaling set protocols isis level 1 disable set protocols isis interface fe-0/1/2.0 set protocols isis interface fe-0/1/3.0 set protocols isis interface lo0.0 set protocols ldp interface all set protocols ldp interface fxp0.0 disable set protocols ldp interface lo0.0 set routing-instances vpls_1 instance-type vpls set routing-instances vpls_1 interface fe-0/1/0.0 set routing-instances vpls_1 route-distinguisher 10.255.107.74:1 set routing-instances vpls_1 vrf-target target:65056:1 set routing-instances vpls_1 protocols vpls no-tunnel-services set routing-instances vpls_1 protocols vpls site site_3 site-identifier 3 set routing-instances vpls_1 protocols vpls site site_3 multi-homing set routing-instances vpls_1 protocols vpls site site_3 site-preference primary set routing-instances vpls_1 protocols vpls site site_3 interface fe-0/1/0.0 set routing-instances vpls_1 protocols vpls site site_994 site-identifier 994 set routing-instances vpls_1 protocols vpls mac-flush
路由器 PE2:
set interfaces fe-0/1/1 encapsulation ethernet-vpls set interfaces fe-0/1/1 unit 0 family vpls set interfaces fe-0/1/2 unit 0 family inet address 10.0.59.13/32 set interfaces fe-0/1/2 unit 0 family iso set interfaces fe-0/1/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.5.1/32 set interfaces lo0 unit 0 family iso address 47.0005.8083.0000.1921.6800.5005.00 set routing-options router-id 192.168.5.1 set protocols mpls interface all set protocols isis level 1 disable set protocols isis interface fe-0/1/2.0 set protocols isis interface lo0.0 set protocols ldp interface all set protocols ldp interface fxp0.0 disable set protocols ldp interface lo0.0 set routing-instances vpls_1 instance-type vpls set routing-instances vpls_1 interface fe-0/1/1.0 set routing-instances vpls_1 route-distinguisher 10.255.107.76:1 set routing-instances vpls_1 vrf-target target:65056:1 set routing-instances vpls_1 protocols vpls no-tunnel-services set routing-instances vpls_1 protocols vpls site site_3 site-identifier 3 set routing-instances vpls_1 protocols vpls site site_3 multi-homing set routing-instances vpls_1 protocols vpls site site_3 site-preference backup set routing-instances vpls_1 protocols vpls site site_3 interface fe-0/1/1.0 set routing-instances vpls_1 protocols vpls site site_995 site-identifier 995 set routing-instances vpls_1 protocols vpls site site_995 best-site set routing-instances vpls_1 protocols vpls mac-flush
路由器 PE3:
set interfaces fe-1/3/0 unit 0 description "PE3 to PE1" set interfaces fe-1/3/0 unit 0 family inet address 10.0.89.13/30 set interfaces fe-1/3/0 unit 0 family iso set interfaces fe-1/3/0 unit 0 family mpls set interfaces fe-1/3/1 encapsulation ethernet-vpls set interfaces fe-1/3/1 unit 0 family vpls set interfaces lo0 unit 0 family inet address 192.168.8.1/32 set interfaces lo0 unit 0 family iso address 47.0005.8083.0000.1921.6800.5002.00 set routing-options router-id 192.168.8.1 set protocols isis level 1 disable set protocols isis interface fe-1/3/0.0 set protocols isis interface lo0.0 set protocols ldp interface all set protocols ldp interface fxp0.0 disable set protocols ldp interface lo0.0 set protocols mpls interface all set routing-instances vpls_1 instance-type vpls set routing-instances vpls_1 interface fe-1/3/1.0 set routing-instances vpls_1 route-distinguisher 10.255.107.72:1 set routing-instances vpls_1 vrf-target target:65056:1 set routing-instances vpls_1 protocols vpls no-tunnel-services set routing-instances vpls_1 protocols vpls site site_2 site-identifier 2 set routing-instances vpls_1 protocols vpls site site_2 interface fe-0/1/0.100 set routing-instances vpls_1 protocols vpls site site_993 site-identifier 993 set routing-instances vpls_1 protocols vpls mac-flush
路由器 PE1
逐步过程
要配置路由器 PE1:
配置接口、接口封装和协议家族。
[edit interfaces] user@PE1# set fe-0/1/0 encapsulation ethernet-vpls user@PE1# set fe-0/1/0 unit 0 family vpls user@PE1# set fe-0/1/2 unit 0 family inet address 10.0.59.14/32 user@PE1# set fe-0/1/2 unit 0 family iso user@PE1# set fe-0/1/2 unit 0 family mpls user@PE1# set fe-0/1/3 unit 0 family inet address 10.0.89.14/30 user@PE1# set fe-0/1/3 unit 0 family iso user@PE1# set interfaces fe-0/1/3 unit 0 family mpls user@PE1# set lo0 unit 0 family inet address 192.168.9.1/32 user@PE1# set lo0 unit 0 family iso address 47.0005.8083.0000.1921.6800.5003.00
配置与协议无关的属性。
[edit routing-options] user@PE1# set router-id 192.168.9.1
在路由器接口上配置 MPLS。
[edit protocols mpls] user@PE1# set interface all
配置 BGP。
[edit protocols bgp] user@PE1# set group int type internal user@PE1# set group int local-address 192.0.2.1 user@PE1# set group int family l2vpn signaling
将 IS-IS 配置为 PE 路由器之间的 IGP。
[edit protocols isis] user@PE1# set level 1 disable user@PE1# set interface fe-0/1/3.0 user@PE1# set interface lo0.0
将 LDP 配置为 MPLS 的信令协议。
[edit protocols ldp] user@PE1# set interface all user@PE1# set interface fxp0.0 disable user@PE1# set interface lo0.0
配置 VPLS 路由实例。
包括该
mac-flush
语句,以确保及时从路由器 PE1 中移除过时的路由。[edit routing-instances vpls_1] user@PE1# set instance-type vpls user@PE1# set interface fe-0/1/0.0 user@PE1# set route-distinguisher 10.255.107.74:1 user@PE1# set vrf-target target:65056:1 user@PE1# set protocols vpls no-tunnel-services user@PE1# set protocols vpls site site_3 site-identifier 3 user@PE1# set protocols vpls site site_3 multi-homing user@PE1# set protocols vpls site site_3 site-preference primary user@PE1# set protocols vpls site site_3 interface fe-0/1/0.0 user@PE1# set protocols vpls site site_994 site-identifier 994 user@PE1# set protocols vpls mac-flush
结果
在配置模式下,输入 show interfaces
、 show protocols
、 show routing-instances
和 show routing-options
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@PE1# show interfaces fe-0/1/0 { encapsulation ethernet-vpls; unit 0 { family vpls; } } fe-0/1/2 { unit 0 { family inet { address 10.0.59.14/32; } family iso; family mpls; } } fe-0/1/3 { unit 0 { family inet { address 10.0.89.14/30; } family iso; family mpls; } } lo0 { unit 0 { family inet { address 192.168.9.1/32; } family iso { address 47.0005.8083.0000.1921.6800.5003.00; } } }
user@PE1# show protocols mpls { interface all; } bgp { group int { type internal; local-address 192.0.2.1; family l2vpn { signaling; } } } isis { level 1 disable; interface fe-0/1/2.0; interface fe-0/1/3.0; interface lo0.0; } ldp { interface all; interface fxp0.0 { disable; } interface lo0.0; }
user@PE1# show routing-instances vpls_1 { instance-type vpls; interface fe-0/1/0.0; route-distinguisher 10.255.107.74:1; vrf-target target:65056:1; protocols { vpls { no-tunnel-services; site site_3 { site-identifier 3; multi-homing; site-preference primary; interface fe-0/1/0.0; } site site_994 { site-identifier 994; } mac-flush; } } }
user@PE1# show routing-options router-id 192.168.9.1;
路由器 PE2
逐步过程
要配置路由器 PE2:
配置接口、接口封装和协议家族。
[edit interfaces] user@PE2# set fe-0/1/1 encapsulation ethernet-vpls user@PE2# set fe-0/1/1 unit 0 family vpls user@PE2# set fe-0/1/2 unit 0 family inet address 10.0.59.13/32 user@PE2# set fe-0/1/2 unit 0 family iso user@PE2# set fe-0/1/2 unit 0 family mpls user@PE2# set lo0 unit 0 family inet address 192.168.5.1/32 user@PE2# set lo0 unit 0 family iso address 47.0005.8083.0000.1921.6800.5005.00
配置与协议无关的属性。
[edit routing-options] user@PE2# set router-id 192.168.5.1
在路由器 PE2 接口上配置 MPLS。
[edit protocols] user@PE2# set mpls interface all
将 LDP 配置为面向接口的 PE 路由器上的 MPLS 信令协议。
[edit protocols ldp] user@PE2# set interface all user@PE2# set interface fxp0.0 disable user@PE2# set interface lo0.0
将 IS-IS 配置为 PE 路由器之间的 IGP。
[edit protocols isis] user@PE2# set level 1 disable user@PE2# set interface fe-0/1/2.0 user@PE2# set interface lo0.0
配置 VPLS 路由实例vpls_1。
包括该
best-site
语句,以确保路由器 PE2 充当 CE 路由器的首选路径。包括该mac-flush
语句,以确保及时从路由器 PE2 中移除过时的路由。[edit routing-instances vpls_1] user@PE2# set instance-type vpls user@PE2# set interface fe-0/1/1.0 user@PE2# set route-distinguisher 10.255.107.76:1 user@PE2# set vrf-target target:65056:1 user@PE2# set protocols vpls no-tunnel-services user@PE2# set protocols vpls site site_3 site-identifier 3 user@PE2# set protocols vpls site site_3 multi-homing user@PE2# set protocols vpls site site_3 site-preference backup user@PE2# set protocols vpls site site_3 interface fe-0/1/1.0 user@PE2# set protocols vpls site site_995 site-identifier 995 user@PE2# set protocols vpls site site_995 best-site user@PE2# set protocols vpls mac-flush
结果
在配置模式下,输入 show interfaces
、 show protocols
、 show routing-instances
和 show routing-options
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@PE2# show interfaces fe-0/1/1 { encapsulation ethernet-vpls; unit 0 { family vpls; } } fe-0/1/2 { unit 0 { family inet { address 10.0.59.13/32; } family iso; family mpls; } } lo0 { unit 0 { family inet { address 192.168.5.1/32; } family iso { address 47.0005.8083.0000.1921.6800.5005.00; } } }
user@PE2# show protocols mpls { interface all; } isis { level 1 disable; interface fe-0/1/2.0; interface lo0.0; } ldp { interface all; interface fxp0.0 { disable; } interface lo0.0; }
user@PE2# show routing-instances vpls_1 { instance-type vpls; interface fe-0/1/1.0; route-distinguisher 10.255.107.76:1; vrf-target target:65056:1; protocols { vpls { no-tunnel-services; site site_3 { site-identifier 3; multi-homing; site-preference backup; interface fe-0/1/1.0; } site site_995 { site-identifier 995; best-site; } mac-flush; } } }
user@pe2# show routing-options router-id 192.168.5.1;
路由器 PE3
逐步过程
要配置路由器 PE3:
配置接口、接口封装和协议家族。
[edit interfaces] user@PE3# set fe-1/3/0 unit 0 description "PE3 to PE1" user@PE3# set fe-1/3/0 unit 0 family inet address 10.0.89.13/30 user@PE3# set fe-1/3/0 unit 0 family iso user@PE3# set fe-1/3/0 unit 0 family mpls user@PE3# set fe-1/3/1 encapsulation ethernet-vpls user@PE3# set fe-1/3/1 unit 0 family vpls user@PE3# set lo0 unit 0 family inet address 192.168.8.1/32 user@PE3# set lo0 unit 0 family iso address 47.0005.8083.0000.1921.6800.5002.00
配置与协议无关的属性。
[edit routing-options] user@PE3# set router-id 192.168.8.1
将 IS-IS 配置为 PE 路由器之间的 IGP。
[edit protocols isis] user@PE3# set level 1 disable user@PE3# set interface fe-0/1/3.0 user@PE3# set interface lo0.0
将 LDP 配置为 MPLS 的信令协议。
[edit protocols ldp] user@PE3# set interface all user@PE3# set interface fxp0.0 disable user@PE3# set interface lo0.0
配置 VPLS 路由实例。
在此处包含该
mac-flush
语句,以确保及时从路由器 PE1 中移除过时的路由。[edit routing-instances vpls_1] user@PE3# set instance-type vpls user@PE3# set interface fe-1/3/1.0 user@PE3# set route-distinguisher 10.255.107.72:1 user@PE3# set vrf-target target:65056:1 user@PE3# set protocols vpls no-tunnel-services user@PE3# set protocols vpls site site_2 site-identifier 2 user@PE3# set protocols vpls site site_2 interface fe-0/1/0.100 user@PE3# set protocols vpls site site_993 site-identifier 993 user@PE3# set protocols vpls mac-flush
结果
在配置模式下,输入 、 show protocols
show routing-instances
和show routing-options
命令,show interfaces
以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@PE3# show interfaces fe-1/3/0 { unit 0 { description "PE3 to PE1"; family inet { address 10.0.89.13/30; } family iso; family mpls; } } fe-1/3/1 { encapsulation ethernet-vpls; unit 0 { family vpls; } } lo0 { unit 0 { family inet { address 192.168.8.1/32; } family iso { address 47.0005.8083.0000.1921.6800.5002.00; } } }
user@PE3# show protocols mpls { interface all; } bgp { group int { type internal; local-address 192.0.2.2; family l2vpn { signaling; } } } isis { level 1 disable; interface fe-1/3/0.0; interface lo0.0; } ldp { interface all; interface fxp0.0 { disable; } interface lo0.0; }
user@PE3# show routing-instances vpls_1 { instance-type vpls; interface fe-0/1/0.100; ## 'fe-0/1/0.100' is not defined route-distinguisher 10.255.107.72:1; vrf-target target:65056:1; protocols { vpls { no-tunnel-services; site site_2 { site-identifier 2; interface fe-1/3/1.0; } site site_993 { site-identifier 993; } mac-flush; } } }
user@pe3# show routing-options router-id 192.168.8.1;