概述
- 随着以太网技术在网络中的大量部署,利用vlan对用户进行隔离和标识受到很大限制。因为IEEE802.1Q中定义的vlan tag 域只有12个bit,仅能标识4094个VLAN,无法满足城域以太网中标识大量用户的需求,于是QINQ技术应运而生
- QINQ(802.1Q IN 801.1Q)技术是一项扩展VLAN空间的技术,通过在802.1Q标签报文的基础上再增加一层802.1Q的tag来达到扩展VLAN空间的功能。
- 如下图所示用户报文在公网上传递时携带了两层TAG,内层是私网TAG,外层是公网TAG。
QINQ封装结构
QINQ封装报文是在无标签的以太网数据帧的源MAC地址字段后面加上两个VLAN标签构成
QINQ工作原理
在公网的传输过程中,设备只根据外层VLAN Tag转发报文,并根据报文的外层VLAN Tag进行MAC地址学习,而用户的私网VLAN Tag将被当作报文的数据部分进行传输,即使私网VLAN Tag相同,也能通过公网VLAN Tag区分不同用户。
QINQ实现方式-基本QINQ
基本QINQ的报文处理过程:
- SW1收到VLAN ID为10 和20的报文,将该报文发送给SW2
- SW2收到该报文后,在该报文原有TAG的外侧再添加一层VLAN ID为100的外层Tag
- 带着两层Tag的用户数据报文在网络中按照正常的二层转发流程转发
- SW3收到VLAN 100的报文后,剥掉报文的外层TAG(VLAN ID 100)。将报文发送给SW4,此时报文只有一层Tag(vlan id为10 或者20)。
- SW4收到该报文,根据VLAN ID和目的MAC地址进行相应的转发。
QINQ实现方式-灵活QINQ
基本QINQ的报文处理过程:
- SW1收到VLAN ID为10 和20的报文,将该报文发送给SW2
- SW2收到VLAN ID为10的报文后,添加一层VLAN ID为100的外层Tag;SW2收到VLAN ID为的20的报文后,添加一层VLAN ID为200的外层TAG。
- 带着两层Tag的用户数据报文在网络中按照正常的二层转发流程转发
- SW3收到VLAN 100的报文后,剥掉报文的外层TAG(VLAN ID 100或者200)。将报文发送给SW4,此时报文只有一层Tag(vlan id为10 或者20)。
- SW4收到该报文,根据VLAN ID和目的MAC地址进行相应的转发。
配置实例
采用基本QINQ基础
SW1:
<SW1>display current-configuration
#
sysname SW1
#
vlan batch 100 200
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100 200
qinq protocol 9100
#
interface GigabitEthernet0/0/2
port link-type dot1q-tunnel
port default vlan 100
#
interface GigabitEthernet0/0/3
port link-type dot1q-tunnel
port default vlan 200
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
user-interface con 0
idle-timeout 0 0
user-interface vty 0 4
#
return
<SW1>
SW2:
<sw2>display current-configuration
#
sysname sw2
#
vlan batch 100 200
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100 200
qinq protocol 9100
#
interface GigabitEthernet0/0/2
port link-type dot1q-tunnel
port default vlan 100
#
interface GigabitEthernet0/0/3
port link-type dot1q-tunnel
port default vlan 200
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
user-interface con 0
idle-timeout 0 0
user-interface vty 0 4
#
return
<sw2>
SW3:
<sw3>display current-configuration
#
sysname sw3
#
vlan batch 10
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
user-interface con 0
idle-timeout 0 0
user-interface vty 0 4
#
return
<sw3>
SW5:
<sw5>display current-configuration
#
sysname sw5
#
vlan batch 10
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
user-interface con 0
idle-timeout 0 0
user-interface vty 0 4
#
return
<sw5>
解释:R4与R6的配置与R3与R5相似
标签:default,报文,VLAN,GigabitEthernet0,技术,QINQ,interface,port From: https://blog.51cto.com/u_13560030/7152010