1.创建vlan,配置access接口
s1/s2/s3:vlan batch 10 20
2.在s1上配置E0/0/2和E0/0/3为access,并划分到相应的vlan
s1:int e0/0/2
s1-e0/0/2:port default vlan 10
s1:int e0/0/3
s1-e0/0/2:port default vlan 20
3.在s2上配置E0/0/3和E0/0/4为access,并划分到相应的vlan
s2:int e0/0/3
s2-e0/0/3:port default vlan 10
s2:int e0/0/4
s2-e0/0/4:port default vlan 20
4.在s1上配置E0/0/1为trunk接口,允许vlan10,vlan20通过
s1:int e0/0/1
s1-e0/0/1:port link-type trunk
s1-e0/0/1:port trunk allow-pass vlan 10 20
5.在s2上配置E0/0/2为trunk接口,允许vlan10,vlan20通过
s2:int e0/0/2
s2-e0/0/2:port link-type trunk
s2-e0/0/2:port trunk allow-pass vlan 10 20
6.在s3上配置G0/0/1,G0/0/2为trunk接口,允许所有vlan通过
s3:int G0/0/1
s3-G0/0/1:port link-type trunk
s3-G0/0/1:port trunk allow-pass vlan all
s3:int G0/0/2
s3-G0/0/2:port link-type trunk
s3-G0/0/2:port trunk allow-pass vlan all