Vlan-mapping、QINQ和802.1q隧道堆叠Vlan

  • Post author:
  • Post category:其他


Vlan-mapping:二层隧道,城域网技术。

在ISP连接客户端的交换机上配置:

①定义truank链路

②启用qinq的vlan转换能力

③定义vlan映射列表

④定义vlan允许列表

实验拓扑:

实验配置:

[sw1]vlan batch 10 20 1000 2000

[sw1]int g 0/0/2	
[sw1-GigabitEthernet0/0/2]port  link-type  trunk 
[sw1-GigabitEthernet0/0/2]qinq vlan-translation enable 
[sw1-GigabitEthernet0/0/2]port vlan-mapping vlan 10 map-vlan 1000
[sw1-GigabitEthernet0/0/2]port vlan-mapping vlan 20 map-vlan 2000
[sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan 1000 2000

[sw1-GigabitEthernet0/0/2]int g 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk 
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 1000 2000
	
[sw 2]vlan batch 10 20 1000 2000

[sw 2]int g 0/0/2
[sw 2-GigabitEthernet0/0/2]port link-type trunk 
[sw 2-GigabitEthernet0/0/2]qinq vlan-translation enable 
[sw 2-GigabitEthernet0/0/2]port vlan-mapping vlan 10 map-vlan 1000
[sw 2-GigabitEthernet0/0/2]port vlan-mapping vlan 20 map-vlan 2000
[sw 2-GigabitEthernet0/0/2]port trunk allow-pass vlan 1000 2000

[sw 2-GigabitEthernet0/0/2]int g 0/0/1
[sw 2-GigabitEthernet0/0/1]port link-type trunk 
[sw 2-GigabitEthernet0/0/1]port trunk allow-pass vlan 1000 2000
[sw3]vlan batch 10 20
[sw3]int g 0/0/3
[sw3-GigabitEthernet0/0/3]port link-type  access 
[sw3-GigabitEthernet0/0/3]port default vlan 10
[sw3-GigabitEthernet0/0/3]int g 0/0/4
[sw3-GigabitEthernet0/0/4]port link-type access 
[sw3-GigabitEthernet0/0/4]port default vlan 20
[sw3-GigabitEthernet0/0/4]int g 0/0/2
[sw3-GigabitEthernet0/0/2]port link-type trunk 
[sw3-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20

[sw4]vlan batch 10 20
[sw4]int g 0/0/3
[sw4-GigabitEthernet0/0/3]port link-type access 
[sw4-GigabitEthernet0/0/3]port default vlan 10
[sw4-GigabitEthernet0/0/3]int g 0/0/4
[sw4-GigabitEthernet0/0/4]port link-type access 
[sw4-GigabitEthernet0/0/4]port default vlan 20
[sw4-GigabitEthernet0/0/4]int g 0/0/2
[sw4-GigabitEthernet0/0/2]port link-type trunk 
[sw4-GigabitEthernet0/0/2]port trunk allow-pass vlan  10 20

测试:

QINQ技术:

双层或多层vlan标记来穿越二层的ISP技术

接口配置802.1q隧道技术:

1. 接口封装802.1q隧道协议

2. 给端口赋予PVID

配置:

sw3和sw4不用动,sw1和sw2配置相同

[sw1]vlan   500

[sw1]int g 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk 
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 500

[sw1-GigabitEthernet0/0/1]int g 0/0/2
[sw1-GigabitEthernet0/0/2]port link-type dot1q-tunnel 	
[sw1-GigabitEthernet0/0/2]port default vlan 500

抓包:两层标签

不同厂商802.1q隧道协议号可能不一致

华为和思科设备都是0x8100,有的设备可能是0x9100

这时候就会出现数据不通的情况,需人为修改协议号

intface g 0/0/2
qinq protocol 0x9100

802.1q隧道堆叠Vlan:

1. 接口须为hybrid

2. 启用qinqvlan映射功能

3. 针对不同vlan定义不同的堆叠vlan

4. 在接口的移除标签列表中增加对应的vlan id

配置:

sw3和sw4不变,sw1和sw2相同

vlan batch 10 20 1000 2000

[sw1]int g 0/0/2
[sw1-GigabitEthernet0/0/2]qinq vlan-translation enable 
[sw1-GigabitEthernet0/0/2]port vlan-stacking vlan 10 stack-vlan 1000
[sw1-GigabitEthernet0/0/2]port vlan-stacking vlan 20 stack-vlan 2000
[sw1-GigabitEthernet0/0/2]port hybrid untagged vlan 1000 2000

[sw1]int g 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 1000 2000

抓包两层标签



版权声明:本文为qq_53332962原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。