图2-1 MUX VLAN示意图
2.2.1 MUX VLAN实验
一.实验拓扑
如图2-2所示,PC7属于主VLAN123;PC1和PC2属于互通型VLAN10;PC3和PC4属于互通型VLAN20;PC5和PC6属于隔离性VLAN30.各个终端的IP地址设计为10.1.1.X,比如PC7的地址为10.1.1.7.
二.实验需求和目标
了解MUX VLAN的工作原理和实验
PC7可以和PC1到PC6通信
互通型VLAN10中的PC1和PC2可以通信,但不能和其他从VLAN中的设备(PC3到PC6)通信
互通型VLAN20中PC3和PC4可以通信,但不能和其他从VLAN中的设备(PC1、PC2、PC5、PC6)通信
隔离性VLAN30中的PC5和PC6相互不能通信,但是可以和PC7通信
三.实验步骤
图2-2 MUX VLAN实验拓扑
1.创建VLAN,并规定对应的VLAN类型
[SW1]vlan batch 10 20 30 123 //创建对应的VLAN,如果交换机上没有该VLAN
[SW1]vlan 123
[SW1-vlan123]mux-vlan //VLAN123使能MUX VLAN
[SW1-vlan123] subordinate separate 30 //VLAN30作为隔离型从VLAN隶属于VLAN123
[SW1-vlan123] subordinate group 10 20 //VLAN30作为互通型从VLAN隶属于VLAN123
验证定义的VLAN
[SW1]display mux-vlan //读者已经看到主vlan123,从vlan中的隔离和互通型VLAN,但暂时还没有接口属于VLAN
Principal Subordinate Type Interface
-----------------------------------------------------------------------------
123 - principal
123 30 separate
123 10 group
123 20 group
请在SW2做对应配置并验证
vlan batch 10 20 30 123
vlan 123
mux-vlan
subordinate separate 30
subordinate group 10 20
[SW2]display mux-vlan
Principal Subordinate Type Interface
-----------------------------------------------------------------------------
123 - principal
123 30 separate
123 10 group
123 20 group
-----------------------------------------------------------------------------**
2.把对应的端口划分到VLAN
VLAN中自然要有物理接口作为转发的承载,在本例中我们将配置交换机之间的Trunk链路以及连接终端的接入接口
SW1:
interface GigabitEthernet0/0/11
port link-type access
port default vlan 123 //该端口属于主VLAN123
port mux-vlan enable //该端口使能MUX VLAN,否则按照普通VLAN转发
interface GigabitEthernet0/0/1
port link-type access //端口模式修改为接入模式
port default vlan 10 //该端口口划分到VLAN10
port mux-vlan enable //该端口使能MUX VLAN才能按照规则转发
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
port mux-vlan enable
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 20 //属于互通型VLAN20的端口
port mux-vlan enable
#
interface GigabitEthernet0/0/4
port link-type access
port default vlan 20
port mux-vlan enable
#
interface GigabitEthernet0/0/10
port link-type trunk
port trunk allow-pass vlan 2 to 4094 //配置Trunk并允许所有VLAN通过
!
SW2:
interface GigabitEthernet0/0/5
port link-type access
port default vlan 30 //属于隔离型VLAN30的端口
port mux-vlan enable
#
interface GigabitEthernet0/0/6
port link-type access
port default vlan 30
port mux-vlan enable
#
interface GigabitEthernet0/0/10
port link-type trunk
port trunk allow-pass vlan 2 to 4094
验证MUX VLAN及其端口
[SW1]display mux-vlan
Principal Subordinate Type Interface
-----------------------------------------------------------------------------
123 - principal GigabitEthernet0/0/7 GigabitEthernet0/0/11
123 30 separate
123 10 group GigabitEthernet0/0/1 GigabitEthernet0/0/2
123 20 group GigabitEthernet0/0/3 GigabitEthernet0/0/4
----------------------------------------------------------------------------- [SW2]display mux-vlan
Principal Subordinate Type Interface
-----------------------------------------------------------------------------
123 - principal
123 30 separate GigabitEthernet0/0/5 GigabitEthernet0/0/6
123 10 group
123 20 group
配置主机的IP地址并验证,我们以PC1为例,其他设备请自行配置并验证
图2-3 配置主机的IP地址
PC>ping 10.1.1.7 //PC1可以和主VLAN中的设备通信
Ping 10.1.1.7: 32 data bytes, Press Ctrl_C to break
From 10.1.1.7: bytes=32 seq=1 ttl=128 time=47 ms
From 10.1.1.7: bytes=32 seq=2 ttl=128 time=47 ms
--- 10.1.1.7 ping statistics ---
2 packet(s) transmitted
2 packet(s) received
0.00% packet loss
round-trip min/avg/max = 47/47/47 ms
PC>ping 10.1.1.2 //PC1可以和同一互通型VLAN中的设备通信
Ping 10.1.1.2: 32 data bytes, Press Ctrl_C to break
From 10.1.1.2: bytes=32 seq=1 ttl=128 time=47 ms
From 10.1.1.2: bytes=32 seq=2 ttl=128 time=31 ms
--- 10.1.1.2 ping statistics ---
2 packet(s) transmitted
2 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/39/47 ms
PC>ping 10.1.1.3 //PC1不能和不同互通型VLAN的PC3通信
Ping 10.1.1.3: 32 data bytes, Press Ctrl_C to break
From 10.1.1.1: Destination host unreachable
From 10.1.1.1: Destination host unreachable
From 10.1.1.1: Destination host unreachable
--- 10.1.1.3 ping statistics ---
3 packet(s) transmitted
0 packet(s) received
100.00% packet loss
PC>ping 10.1.1.5 //PC1不能和隔离型VLAN中的设备通信
Ping 10.1.1.5: 32 data bytes, Press Ctrl_C to break
From 10.1.1.1: Destination host unreachable
From 10.1.1.1: Destination host unreachable
From 10.1.1.1: Destination host unreachable
--- 10.1.1.5 ping statistics ---
3 packet(s) transmitted
0 packet(s) received
100.00% packet loss
验证隔离性VLAN中的主机PC5的情况:
PC>ping 10.1.1.6 //不能和同一隔离型VLAN中的主机通信
Ping 10.1.1.6: 32 data bytes, Press Ctrl_C to break
From 10.1.1.5: Destination host unreachable
From 10.1.1.5: Destination host unreachable
From 10.1.1.5: Destination host unreachable
From 10.1.1.5: Destination host unreachable
--- 10.1.1.6 ping statistics ---
4 packet(s) transmitted
0 packet(s) received
100.00% packet loss
PC>ping 10.1.1.7 //仅仅可以和主VLAN中的设备通信
Ping 10.1.1.7: 32 data bytes, Press Ctrl_C to break
From 10.1.1.7: bytes=32 seq=1 ttl=128 time=62 ms
From 10.1.1.7: bytes=32 seq=2 ttl=128 time=46 ms
--- 10.1.1.7 ping statistics ---
2 packet(s) transmitted
2 packet(s) received
0.00% packet loss
round-trip min/avg/max = 46/54/62 ms
PC>ping 10.1.1.4 //不能和除了主VLAN之外的从VLAN中的设备通信
Ping 10.1.1.4: 32 data bytes, Press Ctrl_C to break
From 10.1.1.5: Destination host unreachable
From 10.1.1.5: Destination host unreachable
--- 10.1.1.4 ping statistics ---
2 packet(s) transmitted
0 packet(s) received
100.00% packet loss
以上已经验证了MUX VLAN内部的通信情况,那么如何和另外一个三层子网(比如20.1.1.0/24网络)通信呢?此时需要使用主VLAN的VLAN接口,由于模拟器的缘故,ENSP不能在MUX VLAN中使用该方式,故而在本实验中不进行演示,但是真实设备没有问题。
华为设备实施MUX VLAN灵活的控制VLAN间互访同时节省IP地址实施
原文地址:http://blog.51cto.com/enderjoe/2088867