拓扑图
配置命令
Switch
enable
vlan database
vlan 2
vlan 3
vlan 4
exit
conf t
int range f0/1-2
switchport mode access
switchport access vlan 2
exit
int range f0/3-4
switchport mode access
switchport access vlan 3
exit
int range f0/5-6
switchport mode access
switchport access vlan 4
end
show vlan
conf t
int vlan 2
ip add 192.168.1.254 255.255.255.0
exit
int vlan 3
ip add 192.168.2.254 255.255.255.0
exit
int vlan 4
ip add 192.168.3.254 255.255.255.0
end
show ip route
conf t
ip routing
end
show ip route
实验结果
Switch
Ping