主要思路:
(1)对于交换机:
1:命名
2:划分VLAN
3:将指定端口划分到指定vlan
4:将指定端口设置成trunk模式
(2)对于PC:(这里把router看成是PC)
1:命名
2:禁止路由功能
3:设置IP
4:ping IP
(3)查看配置命令:
查看vlan :show vlan-switch
查看trunk: show interface f0/0 switchport
----------------------------------------------
配置文档:
sw1:
enable
config terminal
hostname sw1
//命名
exit
vlan database
//添加VLAN并命名
vlan 2 name v2
vlan 3 name v3
exit
config terminal
//将端口添加到指定的VLAN
interface f0/1
switchport access vlan 2
exit
interface f0/2
//将端口添加到指定的VLAN
switchport access vlan 3
exit
interface f0/0
//将指定端口设置成trunk
switchport mode trunk
end
write
----------------------------------------------
sw2:
enable
//命名
config terminal
hostname sw2
exit
vlan database
//添加VLAN并命名
vlan 2 name v2
vlan 3 name v3
exit
config terminal
//将指定端口添加到指定VLAN
interface f0/2
switchport access vlan 2
exit
interface f0/3
//将指定端口添加到指定VLAN
switchport access vlan 3
exit
interface f0/0
//将指定端口设置成trunk
switchport mode trunk
end
write
----------------------------------------------
|