实验topo
将各设备进行基础配置
1.创建vlan、修改端口类型
将交换机之间连接的接口配置为trunk口并放行,将交换机连接PC的接口配置为access口
SW1
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/5
port link-type access
port default vlan 30
SW2
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/5
port link-type access
port default vlan 40
SW3
interface GigabitEthernet0/0/3
port link-type trunk