1、Access:
特点:有且只能属于一个Vlan。
配置文件:vlan batch 2 3
port link-type access
port default vlan 2
2、Trunk:
特点:可以承载多个vlan的流量。
拓扑图:
配置文件:
SW1:
[sw1]vlan batch 10 20
[sw1]interface Ethernet0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port default vlan 10
[sw1]interface Ethernet0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 20
[sw1]interface Ethernet0/0/3
[sw1-Ethernet0/0/3]port link-type trunk
[sw1-Ethernet0/0/3]port trunk allow-pass vlan 10 20
SW2:
[sw2]vlan batch 10 20
[sw2]interface Ethernet0/0/1
[sw2-Ethernet0/0/1]po