SW1
[sw1]int g0/0/2
[sw1-GigabitEthernet0/0/2]dis this
interface GigabitEthernet0/0/2
port link-type access
port default vlan 2 pc1划分到vlan 2
[sw1-GigabitEthernet0/0/3]dis this
interface GigabitEthernet0/0/3
port hybrid pvid vlan 3 设置pvid为vlan3
port hybrid tagged vlan 3
port hybrid untagged vlan 4 to 6
SW2
[sw2]int g0/0/2
interface GigabitEthernet0/0/2
port link-type access 设置模式,为access模式
port default vlan 2 pc3划分到vlan2
interface GigabitEthernet0/0/3
port hybrid pvid vlan 4 默认模式为hybrid模式,划分pvid为vlan4
port hybrid tagged vlan 4
port hybrid untagged vlan 3 5
SW3
[sw3]int g0/0/2
interface GigabitEthernet0/0/2
port hybrid pvid vlan 5 划分pvid为vlan5
port hybrid tagged vlan 5
port hybrid untagged vlan 3 to 4
[sw3-GigabitEthernet0/0/2]int g0/0/3
interface GigabitEthernet0/0/3
port hybrid pvid vlan 6 默认模式为hybrid模式,划分pvid为vlan6
port hybrid tagged vlan 6
port hybrid untagged vlan 3 to 4 允许列表中允许vlan3 4,且允许撕掉标签vlan3 4
交换机
SW1
[sw1]int g0/0/4
interface GigabitEthernet0/0/4
port link-type trunk 定义trunk模式
port trunk allow-pass vlan 2 to 6 允许通过vlan2 3 4 5 6
SW2
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 6
[sw2-GigabitEthernet0/0/1]int g0/0/4
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 6
SW3
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 6
路由器和交换机之间
interface GigabitEthernet0/0/1
port hybrid tagged vlan 2
port hybrid untagged vlan 3 to 5