目的:让PC_3和PC_5处于vlan1, PC_4和PC_6处于vlan2
SW1的配置命令:
vlan 2
port GigabitEthernet 1/0/2
quit
int g1/0/3
port link-type trunk
port trunk permit vlan all
quit
SW2的配置命令:
vlan 2
port GigabitEthernet 1/0/2
quit
int g1/0/3
port link-type trunk
port trunk permit vlan all
quit
PC的ip配置如下
效果:处于同一vlan的才能ping成功