配置过程
在SW1和SW2上创建VLAN10和VLAN20
<SW1>system-view
[SW1]vlan batch 10 20
<SW2>system-view
[SW2]vlan batch 10 20
将PC的交换机端口配置为access模式
SW1
int e0/0/1
port link-type access
port default vlan 10
int e0/0/2
port link-type access
port default vlan 20
quit
SW2
int e0/0/1
port link-type access
port default vlan 10
quit
int e0/0/2
port link-type access
port default vlan 20
quit
将交换机之间的端口配置为trunk模式并放行vlan10和vlan20
SW1
int e0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20
quit
SW2
int e0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20
quit
验证交换机已创建的VLAN信息
display vlan
验证交换机端口模式
display port vlan
配置各PC的IP地址 相互ping通实验