enable
conf t#
hostname SW1#
end#
vlan database#
vlan 2 name VLAN2#
vlan 3 name VLAN3#
exit#
conf t#
int f0/1#
switch mode access#
switch access vlan 2#
exit#
int f1/1#
switch mode access#
switch access vlan 3#
exit#
int f3/1#
switch mode access#
switch access vlan 2#
exit#
Connect one switch and three PCs, set IP and subnet mask, connect to the corresponding ports for ping, PC1 and PC3 in the same VLAN can ping each other, PC2 in different VLAN cannot ping.