第8章Vlan dot1q tunnel配置
本章主要讲述了交换机支持Vlan dot1q tunnel功能以及如何配置该功能。
章节主要内容:
z Vlan dot1q tunnel(mapping)简介
z应用实例
z调试和监控
8.1Vlan dot1q tunnel简介
Vlan dot1q tunnel是基于802.1Q协议的扩展,在原有的802.1Q报文包头上又增加一层802.1Q标签(VLAN标签)实现,通过双层标签,使VLAN个数增加为4K×4K。QinQ将用户私网VLAN Tag封装在公网VLAN Tag中,使报文带着两层VLAN Tag穿越运营商的骨干网络(公网)。在公网中报文只根据外层VLAN Tag(即公网VLAN Tag)传播,用户的私网VLAN Tag被屏蔽,节约了公网VLAN ID,为用户提供一种较为简单的二层VPN隧道。
Vlan dot1q tunnel mapping也是基于802.1Q的扩展,与Vlan dot1q tunnel不同之处在于:Vlan dot1q tunnel mapping不是在报文原有802.1Q的基础上再封装一层802.1Q标签,而是将报文原有802.1Q标签替换成新的802.1Q表项,报文仍然只带有一层802.1Q表项。
8.1.1基本Vlan dot1q tunnel功能
端口使能Vlan dot1q tunnel功能,当端口接收到报文,为报文增加一层VLAN Tag。增加Tag的VLAN ID为端口缺省VLAN  ID。如果接收到的报文是Tag报文,该报文变成双层Tag报文;如果接口到的报文不带Tag,报文为单层Tag报文。
8.1.2灵活Vlan dot1q tunnel功能
灵活Vlan dot1q tunnel功能是与端口VLAN相配合,对Vlan dot1q tunnel的一种灵活实现。端口根据灵活
Vlan dot1q tunnel(mapping)表项,根据报文Tag中的VLAN ID,为报文增加指定的外层VLAN Tag,Vlan dot1q tunnel mapping则是将报文Tag中的VLAN ID 替换为指定的VLAN ID 。如果端口不匹配
灵活Vlan dot1q tunnel (mapping )表项,则给报文封装外层VLAN Tag ,此VLAN Tag 为端口PVID VLAN 。
8.1.3 仅支持灵活Vlan dot1q tunnel 功能
灵活Vlan dot1q tunnel 功能是与端口VLAN 相配合,对Vlan dot1q tunnel 的一种灵活实现。端口根据灵活Vlan dot1q tunnel (mapping )表项,根据报文Tag 中的VLAN ID ,为报文增加指定的外层VLAN Tag ,Vlan dot1q tunnel mapping 则是将报文Tag 中的VLAN ID 替换为指定的VLAN ID 。如果端口不匹
配灵活Vlan dot1q tunnel (mapping )表项,则报文被丢弃。该功能通过配置来实现,见配置命令vlan dot1q-tunnel drop
8.1.4 灵活Vlan dot1q tunnel 报文TPID
TPID (Tag Protocol Identifier ),标签协议标识,是报文中Tag 的一个字段,表示VLAN Tag 对应的协议类型。VLAN Tag 字段 的取值为0x8100。Vlan dot1q tunnel 报文外层VLAN Tag 的取值默认为0x8100,不同厂商可能设置Vlan dot1q tunnel 报文外层VLAN Tag 的取值不同,如取值为0x9100。
8.2 基本指令描述
命令
描述
配置模式
vlan dot1q-tunnel enable 端口使能基本vlan dot1q-tunnel 功能 config-port-xxx
config-link-aggregation-x  vlan dot1q-tunnel vlanId  vlanId
配置端口灵活vlan dot1q-tunnel 表项
config-port-xxx config-link-aggregation-x
vlan dot1q-tunnel
mapping  vlanId  vlanId  配置端口灵活vlan dot1q-tunnel mapping 表项 config-port-xxx config-link-aggregation-x
vlan dot1q-tunnel drop
配置端口仅支持灵活vlan dot1q-tunnel
(mapping )表项;端口接收到的报文不匹配灵活vlan dot1q-tunnel (mapping )表项,丢弃报文 config-port-xxx
config-link-aggregation-x frame-tag tpid tpvalue  配置端口外层Tag 的TPID
config-port-xxx config-link-aggregation-x inner-priority-trust enable
配置端口内层Tag 优先级priority 字段值复制到外层Tag 优先级priority 字段值
config-port-xxx config-link-aggregation-x
vlan dot1q-tunnel enable
端口使能基本vlan dot1q-tunnel 功能。该命令的no形式,端口去使能基本vlan dot1q-tunnel 功能。
vlan dot1q-tunnel enable
no vlan dot1q-tunnel enable
【缺省情况】端口没有vlan dot1q-tunnel enable配置,不使能基本vlan dot1q-tunnel功能。
注:
不能在同一端口上配置基本QinQ(vlan dot1q-tunnel enable)和流QINQ。流QinQ的相关信息请参看《ACL配置》。
不能在配置基本QinQ(vlan dot1q-tunnel enable)的端口上,启用端口安全功能。
vlan dot1q-tunnel
配置端口灵活vlan dot1q-tunnel表项。该命令的no形式,删除端口配置的灵活vlan dot1q-tunnel表项。
vlan dot1q-tunnel vlanId vlanId
no vlan dot1q-tunnel  vlanId
语法描述
vlanId 前一个vlanId,表示报文Tag中的VLAN ID,取值
范围为1~4094
vlanId后一个vlanId,表示新增外层Tag的VLAN ID,取
值范围为1~4094
注:
端口的tpid值为非默认值(默认值为0x8100)时,即端口frame-tag tpid配置存在条件下,不能进行基本Vlan dot1q tunnel功能的配置操作。
在端口使能基本Vlan dot1q tunnel功能的条件下,端口灵活Vlan dot1q tunnel功能才能生效。
当新配置的灵活Vlan dot1q tunnel表项时,如果存在冲突表项,系统自动将删除所有冲突的Vlan dot1q tunnel(mapping)表项,然后再设置新表项。
灵活Vlan dot1q tunnel功能,是通过灵活Vlan dot1q tunnel表项与端口VLAN相配合实现的。因此,需要通过配置,将Vlan dot1q tunnel端口加入到外层VLAN中。
注意:
灵活Vlan dot1q tunnel表项,不能在Access端口上配置,只能在Hybrid和Trunk模式类型的端口上配置。
当端口由Hbyrbid类型或Trunk类型转换为Access模式类型,端口上的所有灵活Vlan dot1q tunnel (mapping)表项被删除。
在汇聚端口(link-aggregation)上配置Vlan dot1q tunnel/Vlan dot1q tunnel mapping表项时,建议用户先将所有成员端口加入汇聚端口(link-aggregation),然后在汇聚端口上配置。
对于MyPower S6800A,标准模式下,系统支持768条灵活Vlan dot1q tunnel/Vlan dot1q tunnel mapping硬件表项;其他模式下,系统总计支持4096条灵活Vlan dot1q tunnel/Vlan dot1q tunnel mapping 硬件表项。
对于每一个汇聚口上的表项会占用16条硬件表项,以满足汇聚组内端口数最多时使用。
存在Vlan dot1q tunnel相关配置的端口上,端口VLAN帧过滤的部分配置无效。建议用户不进行端口VLAN帧过滤配置,保持默认配置,即端口应该允许所有帧(Tag帧和Untag帧)通过。
端口类型配置和端口VLAN帧过滤相关内容见《第4章 VLAN配置》。
vlan dot1q-tunnel mapping
配置端口灵活vlan dot1q-tunnel mapping表项。该命令的no形式,删除端口配置的灵活vlan dot1q-tunnel mapping表项。
vlan dot1q-tunnel mapping vlanId vlanId
no vlan dot1q-tunnel mapping vlanId
语法描述
vlanId 前一个vlanId,表示报文Tag中的VLAN ID,取值
范围为1~4094
vlanId后一个vlanId,表示替换Tag的VLAN ID,取值范
围为1~4094
注:
在端口使能基本Vlan dot1q tunnel功能的条件下,端口灵活Vlan dot1q tunnel mapping功能才能生效。
当新配置的灵活Vlan dot1q tunnel mapping表项时,如果存在冲突表项,系统自动将删除所有冲突的Vlan dot1q tunnel(mapping)表项,然后再设置新表项。
灵活Vlan dot1q tunnel mapping功能,是通过灵活Vlan dot1q tunnelmapping表项与端口VLAN相配合实现的。因此,需要通过配置,将Vlan dot1q tunnel mapping端口加入到替换VLAN中。
注意:
灵活Vlan dot1q tunnel mapping表项,不能在Access端口上配置,只能在Hybrid和Trunk模式类型的端口上配置。
当端口由Hbyrbid类型或Trunk类型转换为Access模式类型,端口上的所有灵活Vlan dot1q tunnel (mapping)表项被删除。
在汇聚端口(link-aggregation)上配置Vlan dot1q tunnel/Vlan dot1q tunnel mapping表项时,建议用户先将所有成员端口加入汇聚端口(link-aggregation),然后在汇聚端口上配置。
系统总计支持4096条灵活Vlan dot1q tunnel/Vlan dot1q tunnel mapping硬件表项。
存在Vlan dot1q tunnel mapping相关配置的端口上,端口VLAN帧过滤的部分配置无效。建议用户不进行端口VLAN帧过滤配置,保持默认配置,即端口应该允许所有帧(Tag帧和Untag帧)通过。
端口类型配置和端口VLAN帧过滤相关内容见《第4章 VLAN配置》。
vlan dot1q-tunnel drop
配置端口仅支持灵活vlan dot1q-tunnel (mapping)表项;端口接收到的报文不匹配灵活vlan dot1q-tunnel (mapping)表项,丢弃报文。该命令的no形式,删除端口仅支持灵活vlan dot1q-tunnel (mapping)表项的配置。
vlan dot1q-tunnel drop
no vlan dot1q-tunnel drop
【缺省情况】端口不使能基本vlan dot1q-tunnel drop功能。
frame-tag tpid
配置端口的外层Tag中的TPID值。该命令的no形式,删除端口配置的外层Tag中TPID值,恢复为默认值0x8100
frame-tag tpid tpvalueenable的名词形式
no frame-tag tpid
语法描述
tpvalue外层Tag的TPID(其他设备商常使用TPID值为
0x9100)
【缺省情况】缺省值为0x8100
注:
1.当端口基本Vlan dot1q tunnel功能使能时,不能进行frame-tag tpid的配置操作。
2.对于MyPower S6800A,标准模式下,能够配置3个TPID(0x8100除外),其他
模式下能够配置2个TPID(0x8100除外)。
inner-priority-trust enable
配置端口内层Tag优先级priority字段值复制到外层Tag优先级priority字段值。该命令的no形式,删除此配置。
inner-priority-trust enable
no inner-priority-trust enable
【缺省情况】没有inner-priority-trust enable配置
8.3应用实例
PE1和PE2为运营商网络设备,Customer A 、Customer B 、Customer 为用户网络设备。
组网需求:Customer A的 VLAN 10报文和CustomerC的VLAN 10报文,通过运营商网络的VLAN 100 互通。Customer B的 VLAN 20报文和CustomerC的VLAN 20报文,通过运营商网络的VLAN 200 互通。
8-1 组网图