示意图

192100433.jpg

S1配置

port e0/10

vlan20

port e0/20

int e0/24

port link-type trunk

port trunk permit vlan all

192100933.png

S2配置

vlan 10

vlan 20

int vlan-interface 10

ip add 192.168.10.1 255.255.255.0    

int vlan-interface 20

ip add 192.168.20.1 255.255.255.0



int e0/24

port link-type trunk

port trunk permit vlan all

192100989.png

ping

192058892.jpg