创建vlan:
[sw1]vlan 10 //创建VLAN10
[sw1-vlan10]vlan 20 //创建VLAN20
配置access:
[sw1]interface Ethernet 0/0/1 //进入以太网接口0/0/1
[sw1-Ethernet0/0/1]port link-type access //配置接口类型为Access
[sw1-Ethernet0/0/1]port default vlan 10 //分配接口给VLAN10
配置trunk:
[sw1]interface Ethernet 0/0/4
[sw1-Ethernet0/0/4]port link-type trunk //配置接口类型为trunk
[sw1-Ethernet0/0/4]port trunk allow-pass vlan 10 20//trunk口允许通过的VLAN