要通过网络提供第 2 层 VPN 服务,您可能需要配置在进出边缘路由器的帧上推送、弹出或交换 802.1Q 标记的功能,从而允许您使用单个 VLAN 电路交叉连接 (CCC) [VLAN-CCC] 逻辑接口来处理双标记和单标记数据包。因此,此功能可在第 2 层服务与本地或远程端的不同 VLAN 之间提供互操作性,或者在第 2 层服务附带特定 VLAN,但远程对等方具有不同 VLAN 或没有 VLAN 的情况下提供互操作性。
此功能包括在 VLAN CCC 逻辑接口上成功执行 VLAN 标记操作后,能够通过第 2 层电路启用某些以太网类型/DMAC 匹配帧的直通。
如果配置此功能,则当流量发送到第 2 层电路接口或从第 2 层电路接口发送流量时,将应用 VLAN 标记。弹出、推送和交换操作仅在外部标记上执行。弹出的 VLAN 标记会从 VLAN 标记堆栈的顶部移除 VLAN 标记。推送 VLAN 标记添加新的外部 VLAN 标记,交换 VLAN 标记将现有的外部 VLAN 标记替换为新的 VLAN 标记。
您可以在单个以太网网络接口或聚合以太网接口上配置 inet、inet6 或 VLAN-CCC 连接,以便为同一接口上的标记和未标记流量设置不同的转发规则。例如,您可以通过第 2 层电路转发已标记的数据包,并在本地 VLAN 模式下路由未标记的流量。
使用 功能资源管理器 确认平台和版本对特定功能的支持。
注:
此功能在 PTX 路由器上的限制包括:
-
不支持对 STP 和 CDP 数据包执行 VLAN 操作。
-
您无法使用本机 VLAN ID 配置 VLAN-CCC 逻辑接口。
-
如果配置 l2circuit-control-passthrough
。(但是,静态 LAG 有效。
要使用 VLAN CCC、基于 MPLS 的第 2 层电路、VLAN 弹出、推送和交换操作以及启用某些以太网类型/DMAC 匹配帧的直通来配置 PE 路由器:
注:
以下过程使用路由器网络接口的实际接口名称而不是变量 interface-name ,以便您可以快速查看其配置差异。请记住,您还可以在聚合以太网接口上配置该功能。
-
在环路(或路由器地址)和核心接口上配置 OSPF:
[edit]
user@host# set protocols ospf area 0.0.0.0 interface lo0.0 passive
user@host# set protocols ospf area 0.0.0.0 interface et-0/0/0:0
-
为路由协议启用流量工程:
[edit]
user@host# set protocols ospf traffic-engineering
-
为环路接口和核心接口配置 IP 地址:
[edit]
user@host# set interfaces lo0 unit logical-unit-number family inet address address
user@host# set interfaces et-0/0/0:0 unit 0 family inet address address
-
将客户边缘接口配置为从本地 PE 路由器到其他 PE 路由器的第 2 层电路:
提示:
使用其他路由器的路由器地址作为邻居地址。它是虚拟电路标识符和邻居地址,为电路提供唯一地址。
[edit]
user@host# set protocols l2circuit neighbor address interface et-0/0/1:1.0 virtual-circuit-id identifier
-
在核心接口上配置 MPLS:
[edit]
user@host# set protocols mpls interface all
-
在环路接口和核心接口上配置 LDP:
[edit]
user@host# set ldp interface lo0.0
user@host# set ldp interface et-0/0/0.0
user@host# set ldp interface all
-
在核心接口的逻辑单元上配置
family mpls
:
[edit]
user@host# set interfaces et-0/0/0:0 unit 0 family mpls
注: 您可以在单个接口、聚合以太网接口或标记 VLAN 接口上启用 family mpls
。
-
指定路由器 ID:
[edit]
user@host# set routing-options router-id address
-
在本地 PE 路由器的客户边缘接口上启用 VLAN 标记:
[edit]
user@host# set interfaces et-0/0/1:1 vlan-tagging
-
将客户边缘接口配置为使用灵活的以太网服务封装:
[edit]
user@host# set interfaces et-0/0/1:1 encapsulation flexible-ethernet-services
-
使用 VLAN ID 配置客户边缘接口的逻辑单元:
[edit]
user@host# set interfaces et-0/0/1:1 unit 0 vlan-id vlan-id
-
将客户边缘接口上的逻辑单元配置为使用 VLAN CCC 封装:
[edit]
user@host# set interfaces et-0/0/1:1 unit 0 encapsulation vlan-ccc
-
在客户边缘接口上配置逻辑单元,以从输入 VLAN 中弹出标记,然后将标记推送到输出 VLAN:
[edit]
user@host# set interfaces et-0/0/1:1 unit 0 input-vlan-map push
[edit]
user@host# set interfaces et-0/0/1:1 unit 0 output-vlan-map pop
-
(可选)配置第 2 层电路跟踪选项:
[edit]
user@host# set protocols l2circuit traceoptions file l2ckt.log
user@host# set protocols l2circuit traceoptions flag connections detail
-
(可选)配置 VLAN CCC 逻辑接口,以便忽略此接口与其他 PE 路由器上的接口之间的封装不匹配和 MTU 不匹配:
[edit]
user@host# set protocolsl2circuit neighbor address interface et-0/0/1:1.0 ignore-encapsulation-mismatch
user@host# set protocolsl2circuit neighbor address interface et-0/0/1:1.0 ignore-mtu-mismatch
-
在适用的平台上,为了启用某些 Ethertype/DMAC 匹配帧的直通,请配置第 2 层电路控制直通:
[edit]
user@host# set forwarding-options l2circuit-control-passthrough