本实验环境为:Cisco Packet Tracer 5.3

 拓扑如下:

 

PC1的配置:

 

 

 

PC2的配置:

 

 

 

三层交换机的配置:

1.实现f0/1àvlan1:vlan1ip192.168.1.254

Switch>en

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#int vlan 1

Switch(config-if)#ip add 192.168.1.254 255.255.255.0

Switch(config-if)#no shut

%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

Switch(config-if)#int f0/1

Switch(config-if)#sw acc vlan 1

 

2.实现f0/2àvlan2:vlan2ip192.168.2.254

Switch(config)#vlan 2

Switch(config-vlan)#int vlan 2

%LINK-5-CHANGED: Interface Vlan2, changed state to up

Switch(config-if)#ip add 192.168.2.254 255.255.255.0

Switch(config-if)#no shut

Switch(config-if)#int f0/2

Switch(config-if)#sw acc vlan 2

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to up

Switch(config-if)#

 

3.很重要的下一步,开启三层交换机的路由功能

Switch(config)#ip routing

测试:pc1 ping pc2

 

 

试验完成。