在实际运营商和企业运维中,经常会遇到一些非常具体的二层透传需求——例如客户希望把 A 机房与 B 机房的设备拉成同一个二层广播域,或者在 A 地区直接拨入 B 地区总部/ISP 提供的 PPPoE 宽带接入服务。本文将介绍如何使用 Juniper MPLS L2Circuit(Pseudo-Wire,ethernet-ccc / vlan-ccc) 以极简配置提供运营商级虚拟网线服务。
方案选型对比:为什么选择 MPLS L2Circuit?
在实现跨地区二层延伸时,几种主流方案各有取舍:
- 传统 IP 路由 + GRETAP 桥接:可行,但需要在两端服务器或网关分别建立 GRETAP 二层隧道并手动维护网桥,配置与故障排查成本极高;
- MPLS L3VPN:不可行,因为 VRF 会天然隔离广播域,而 PPPoE 发现阶段(PADI/PADO)依赖同一二层广播域广播交互;
- VPLS 与 VXLAN:可行,但对于大量点到点 Broadband 接入场景,逐业务维护虚拟交换实例(VSI/VNI)过于繁重;
- MPLS L2Circuit(Pseudo-Wire):两端 PE 仅需不到 20 行配置即可拉通一条透明点对点虚拟网线,非常适合大规模点对点二层专线与远程 PPPoE 延伸。
实验拓扑与场景说明
本实验模拟分支站点 Ori-Branch@Area0(Ori-Client)需要直接拨入总部 Ori-Headquarter 提供的 PPPoE BRAS(MikroTik RouterOS)访问公网的场景。ISP Transit Area 0 内部已经预先配好 OSPF + LDP(无需运行 BGP),我们只需在入口 PE(VCP1)与出口 PE(VCP3)上启用 Pseudo-Wire 即可。
一、配置入口与出口 PE(VCP1 / VCP3)的 L2Circuit
在 VCP1(10.0.0.1)与 VCP3(10.0.0.3)上分别建立 MPLS LSP 隧道,将客户端/BRAS 接入端口 ge-0/0/2 封装为 ethernet-ccc 模式,并通过相同 virtual-circuit-id 100 建立点对点伪线:
protocols {
mpls {
label-switched-path R1-R3 {
to 10.0.0.3; // 定义 MPLS PATH 到对端 PE 设备,可通过同一 LSP 承载多个 L2Circuit 服务
}
interface ge-0/0/1.0;
}
l2circuit {
neighbor 10.0.0.3 {
interface ge-0/0/2.0 {
virtual-circuit-id 100; // 定义伪线邻居与虚拟电路 ID(不冲突且两端需一致)
}
}
}
}
interfaces {
ge-0/0/2 {
encapsulation ethernet-ccc; // 将接口封装为 ethernet-ccc 模式以启用伪线功能
unit 0 {
family ccc; // 激活 ccc 地址族提供透明二层伪线转发
}
}
}
protocols {
mpls {
label-switched-path R3-R1 {
to 10.0.0.1; // 定义 MPLS PATH 到对端 PE 设备,可通过同一 LSP 承载多个 L2Circuit 服务
}
interface ge-0/0/1.0;
}
l2circuit {
neighbor 10.0.0.1 {
interface ge-0/0/2.0 {
virtual-circuit-id 100; // 定义伪线邻居与虚拟电路 ID(需与对端保持一致)
}
}
}
}
interfaces {
ge-0/0/2 {
encapsulation ethernet-ccc; // 将接口封装为 ethernet-ccc 模式以启用伪线功能
unit 0 {
family ccc; // 激活 ccc 地址族提供透明二层伪线转发
}
}
}
二、检查 mpls.0 标签表与 L2Circuit 连接状态
配置提交后,在 VCP1(R1) 上检查 mpls.0 转发表,可以看到接口 ge-0/0/2.0 已压入两层 MPLS 标签(内层伪线标签 299776 + 外层传输标签 299840),并且反向标签 299776 对应弹出后直接送出 ge-0/0/2.0:
root@R1> show route table mpls.0
mpls.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0 *[MPLS/0] 22:13:11, metric 1
to table inet.0
0(S=0) *[MPLS/0] 22:13:11, metric 1
to table mpls.0
1 *[MPLS/0] 22:13:11, metric 1
Receive
2 *[MPLS/0] 22:13:11, metric 1
to table inet6.0
2(S=0) *[MPLS/0] 22:13:11, metric 1
to table mpls.0
13 *[MPLS/0] 22:13:11, metric 1
Receive
299776 *[L2CKT/7] 21:57:36
> via ge-0/0/2.0, Pop Offset: 4
299792 *[LDP/9] 22:11:04, metric 1
> to 100.64.10.2 via ge-0/0/0.0, Pop
299792(S=0) *[LDP/9] 22:11:04, metric 1
> to 100.64.10.2 via ge-0/0/0.0, Pop
299808 *[LDP/9] 22:10:57, metric 1
> to 100.64.10.2 via ge-0/0/0.0, Swap 299840
ge-0/0/2.0 *[L2CKT/7] 21:57:36, metric2 1
> to 100.64.10.2 via ge-0/0/0.0, Push 299776, Push 299840(top) Offset: 252
继续执行 show l2circuit connections 确认 VC 100 状态为 Up:
root@R1> show l2circuit connections
Layer-2 Circuit Connections:
Legend for connection status (St)
EI -- encapsulation invalid NP -- interface h/w not present
MM -- mtu mismatch Dn -- down
EM -- encapsulation mismatch VC-Dn -- Virtual circuit Down
CM -- control-word mismatch Up -- operational
VM -- vlan id mismatch CF -- Call admission control failure
OL -- no outgoing label IB -- TDM incompatible bitrate
NC -- intf encaps not CCC/TCC TM -- TDM misconfiguration
BK -- Backup Connection ST -- Standby Connection
CB -- rcvd cell-bundle size bad SP -- Static Pseudowire
LD -- local site signaled down RS -- remote site standby
RD -- remote site signaled down HS -- Hot-standby Connection
XX -- unknown
Legend for interface status
Up -- operational
Dn -- down
Neighbor: 10.0.0.3
Interface Type St Time last up # Up trans
ge-0/0/2.0(vc 100) rmt Up Jun 10 10:16:22 2020 1
Remote PE: 10.0.0.3, Negotiated control-word: Yes (Null)
Incoming label: 299776, Outgoing label: 299776
Negotiated PW status TLV: No
Local interface: ge-0/0/2.0, Status: Up, Encapsulation: ETHERNET
Flow Label Transmit: No, Flow Label Receive: No
三、分支站点 PPPoE 拨号与上网实测
Pseudo-Wire ge-0/0/2.0(vc 100) 已正常 UP。下面在分支客户端 Ori-Branch@Area0 – Ori-Client(Windows)上直接新建 PPPoE 宽带拨号连接总部 BRAS(MikroTik RouterOS,账号与密码均为 ori,BRAS 侧配置已省略):



分支客户端已成功通过 MPLS L2Circuit 虚拟网线连接至总部 PPPoE BRAS 并获得完整互联网访问权限,客户需求顺利交付。