本次实验所用拓扑图如下所示。模拟器为CISCO PACKET TRACER 5.2版本。三层交换的目的是为了通过三层交换机实现跨VLAN之间的访问。
PC0:IP:192.168.1.2 ga:192.168.1.1 PC1:IP:192.168.2.2 ga:192.168.2.1
实验结果的验证:PC0能够PING通PC1
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

SW1详细配置:
Switch(config)#host SW1
SW1(config)#vlan 10
SW1(config-vlan)#exit
SW1(config)#int f 0/2
SW1(config-if)#sw a vlan 10
SW1(config-if)#no shut
SW1(config-if)#exit
SW1(config)#int f 0/1
SW1(config-if)#sw mo tr (这一步新手比较容易忽略,将f 0/1口设为trunk口)
SW2详细配置:
Switch(config)#host SW2
SW2(config)#int f 0/1
SW2(config-if)#sw mo tr
SW2(config-if)#exit
SW2(config)#vlan 20
SW2(config-vlan)#exit
SW2(config)#int f 0/2
SW2(config-if)#sw a vlan 20
SW2(config-if)#no shut
SW3详细配置:
Switch(config)#host SW3
SW3(config)#vlan 10
SW3(config-vlan)#exit
SW3(config)#vlan 20
SW3(config-vlan)#exit
SW3(config)#int vlan 10
SW3(config-if)#ip add 192.168.1.1 255.255.255.0
SW3(config-if)#no shut
SW3(config-if)#exit
SW3(config)#int vlan 20
SW3(config-if)#ip add 192.168.2.1 255.255.255.0
SW3(config-if)#no shut
SW3(config-if)#exit
实验结果见附件 ^
转载于:https://blog.51cto.com/long007/347884