Vlan Mapping实验
1、作用:vlan id d的替换
2、要求:
现在有电信、联通运营商 ,pc1属于vlan10 ,pc2 属于vlan20 ,允许PC1: 192.168.1.1/24 ping 通 PC2 :192.168.1.2,同时只允许Vlan30 通过。
实验
[SW2]
interface GigabitEthernet0/0/1
qinq vlan-translation enable //开启vlan mapping 功能
port link-type trunk
port trunk allow-pass vlan 30
port vlan-mapping vlan 10 map-vlan 30 //在vlan mapping 中将vlan 10 转换 vlan 30
[SW3]
interface GigabitEthernet0/0/2
qinq vlan-translation enable //开启vlan mapping 功能
port link-type trunk
port link-type trunk
port trunk allow-pass vlan 30
port vlan-mapping vlan 20 map-vlan 30 //在vlan mapping 中将vlan 20 转换 vlan 30
配置PC1/PC2 基本ip地址
[SW1]VLAN 10
[SW1-vlan10]INT G 0/0/1
[SW1-GigabitEthernet0/0/1]P L A
[SW1-GigabitEthernet0/0/1]P D V 10
[SW1-GigabitEthernet0/0/1]INT G 0/0/2
[SW1-GigabitEthernet0/0/2]P L T
[SW1-GigabitEthernet0/0/2]P T A V 10
UNDO terminal monitor
[Huawei]SYS SW4
[SW4]VLAN 20
[SW4-vlan20]Q
[SW4]INT G 0/0/2
[SW4-GigabitEthernet0/0/2]P L A
[SW4-GigabitEthernet0/0/2]P D V 20
[SW4-GigabitEthernet0/0/2]INT G 0/0/1
[SW4-GigabitEthernet0/0/1]P L T
[SW4-GigabitEthernet0/0/1]P T A V 20
UNDO terminal monitor
Huawei]SYS SW2
[SW2]VLAN batch 10 30
[SW2]INT G 0/0/1
[SW2-GigabitEthernet0/0/1]P LT
Error: Unknown host LT.
[SW2-GigabitEthernet0/0/1]P L T
[SW2-GigabitEthernet0/0/1]P T A V 30
[SW2-GigabitEthernet0/0/1]INT G 0/0/2
[SW2-GigabitEthernet0/0/2]P L T
[SW2-GigabitEthernet0/0/2]P T A V 30
[SW2-GigabitEthernet0/0/2]INT G0/0/1
[SW2-GigabitEthernet0/0/1]qinq vlan-translation enable //开启vlan mapping 功能
[SW2-GigabitEthernet0/0/1]PO
[SW2-GigabitEthernet0/0/1]port V
[SW2-GigabitEthernet0/0/1]port vlan-mapping vlan 10 map-vlan 30 //在vlan mapping中将vlan 10 转换vlan 30
UNDO terminal monitor
Info: Current terminal monitor is off.
SY
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]SYS SW3
[SW3]VLAN BA
[SW3]VLAN batch 20 30
Info: This operation may take a few seconds. Please wait for a moment…done.
[SW3]INT G 0/0/1
[SW3-GigabitEthernet0/0/1]P L T
[SW3-GigabitEthernet0/0/1]P T A V 30
[SW3-GigabitEthernet0/0/1]INT G 0/0/2
[SW3-GigabitEthernet0/0/2]P L T
[SW3-GigabitEthernet0/0/2]P T A V 30
[SW3-GigabitEthernet0/0/2]INT G 0/0/1
[SW3-GigabitEthernet0/0/2]qinq vlan-translation enable
[SW3-GigabitEthernet0/0/2]port vlan-mapping vlan 20 map-vlan 30