access接口

Ethernet 
Eth ern et ONI 
sys name SWI 
undo info-center enable 
vIan batch la 
interface Ethernetø/ø/l 
port link-type access 
port default vlan 10 
interface Ethernetø/Ø/2 
port link-type access 
port default vlan 10 
Eth ern et ONI 
ern et 010/2 
ern 
sysname sw2 
undo info-center enable 
vIan batch la 
interface Ethernetø/ø/l 
port link-type access 
port default vlan 10 
interface Ethernetø/Ø/2 
port link-type access 
port default vlan 10 
00/1

Access原理:

vlan划分—基于接口_VLAN划分

 

----------------------------------------------

Access+Trunk接口

 VLAN10访问VLAN20

Ethernet 
Eth ern et 00/1 
sysname SWI 
undo info-center 
vlan batch Ia 
enable 
Eth ern et 0/011 
ern et 00/2 
ern 
yuan 
sysname sw2 
undo info-center enable 
"Ian batch Ia 20 
interface Ethernete/ê/l 
port link-type trunk 
port trunk pvid vlan 2e 
port trunk allow-pass vlan 10 
interface Ethernete/ê/2 
port link-type access 
port default vlan 10 
0,0/1 
interface Ethernete/ê/l 
port link-type access 
port default vlan 10 
interface Ethernete/ê/2 
port link-type access 
port default vlan 10

Trunk接口原理:

vlan划分—基于接口_VLAN划分_02

 

----------------------------------------------

Hybrid接口

Vlan10和VLAN20能访问VLAN30,彼此不能互通

hybrid 
Ethernet 
Eth ern et ONI 
sys name SWI 
ern et 010/3 
ern et ONI 
Eth ern et 0/011 
Ethernet 
ern et ONI 
Ethernet 
ern et ONI 
undo info-center enable 
vIan batch la 
interface Ethernetø/ø/l 
port hybrid tagged vIan la 
interface Ethernetø/Ø/2 
port hybrid pvid VI an la 
undo port hybrid VI an I 
port hybrid untagged vIan 
interface Ethernetø/Ø/3 
port hybrid pvid VI an 20 
undo port hybrid VI an I 
port hybrid untagged vIan 
20 
2a 
30 
30 
sys name sw2 
undo info-center enable 
vIan batch la 20 
interface Ethernetø/ø/l 
port hybrid tagged vIan la 20 3e 
interface Ethernetø/Ø/2 
port hybrid pvid VI an la 
port hybrid untagged vIan la 30 
interface Ethernetø/Ø/3 
port hybrid pvid VI an 30 
port hybrid untagged vIan la 20 3e

Hybrid接口原理:

解析:

1.SW1的Ehternet0/0/2接收到PC1的untagged帧后打上PVID=10后(VLAN10的数据帧),且在允许通过VLAN列表中,变成带Tag=10的帧进入交换机内部

2.SW1的Ehternet0/0/1允许通行的VLAN列表中有VLAN10,Tag=10的帧从该接口发出

3.SW2的Ehternet0/0/1也允许通行VLAN10,Tag=10的帧被交换机接收

4.SW2的Ehternet0/0/2当前接口设置了允许VLAN10通行且发送时不带Tag,所以从该接口发送的是untagged帧,从而被PC4接收

vlan划分—基于接口_VLAN划分_03