拓扑是我官方下载的,内容是我亲手试验的记录,希望大家可以参考----cisco2960交换机
一执行交换机上的基本配置任务
___
重点理解本征
vlan
,管理
vlan
-----
创建
VLAN
-----
分配交换机端口到
VLAN switchport access vlan number
-----
添加、移动和更改端口
-----
检验
VLAN
配置
s2#show vlan id 20
-----
对交换机间连接启用中继
1 switchport mode trunk
2 switchport trunk native vlan 99
-----
检验中继配置
show inter trunk
-----
保存
VLAN
配置配置
vlan
1
在三个交换机上类似设置
S1(config)#vlan 10
S1(config-vlan)#name staff
S1(config-vlan)#vlan 20
S1(config-vlan)#name students
S1(config-vlan)#vlan 30
S1(config-vlan)#name guest
S1(config-vlan)#vlan 99
S1(config-vlan)#name management
S1(config-vlan)#end
2
给端口分配
vlan------
注意
range
命令的端口之间应该有破折号
Switch(config)#inter range f0/6 - 10
Switch(config-if-range)# switchport access vlan 30
Switch(config-if-range)#inter range f0/11 - 17
Switch(config-if-range)# switchport access vlan 10
Switch(config-if-range)#inter range f0/18 - 24
Switch(config-if-range)# switchport access vlan 20
Switch(config-if-range)#end
3
检查是否已经分配成功
Switch#show vlan id 10
4
管理
VLAN
管理
VLAN
配置用于访问
vlan
功能的
vlan
S1(config)#interface vlan 99
S1(config-if)#ip address 172.17.99.11 255.255.255.0
S1(config-if)#no shutdown
S2(config)#interface vlan 99
S2(config-if)#ip address 172.17.99.12 255.255.255.0
S2(config-if)#no shutdown
S3(config)#interface vlan 99
S3(config-if)#ip address 172.17.99.13 255.255.255.0
S3(config-if)#no shutdown
二
为中继端口配置中继和本征
vlan
。默认情况下中继端口属于所有
vlan
,接入端口仅属于一个
vlan
。注意
native vlan
是用于
trunk
口
.
在
access
口没有
native vlan
的概念
.
------ s1(config)#inter range f0/1 - 5
s1(config-if-range)#switchport mode trunk
s1(config-if-range)#switchport trunk native vlan 99
s1(config-if-range)#no shut
-------s1#show inter trunk
Port Mode Encapsulation Status Native vlan
Fa0/1 on 802.1q trunking 99
Fa0/2 on 802.1q trunking 99
Port Vlans allowed on trunk
Fa0/1 1-1005
Fa0/2 1-1005
Port Vlans allowed and active in management domain
Fa0/1 1,10,20,30,99,1002,1003,1004,1005
Fa0/2 1,10,20,30,99,1002,1003,1004,1005
Port Vlans in spanning tree forwarding state and not pruned
Fa0/1 1,10,20,30,99,1002,1003,1004,1005
Fa0/2 1,10,20,30,99,1002,1003,1004,1005
三
检验
----1
在三个交换机上
ping
管理地址均能成功
----2
仅有属于同一
vlan
的
pc
才能
ping
通
s2# show inter trunk
Port Mode Encapsulation Status Native vlan
Fa0/1 on 802.1q trunking 99
Port Vlans allowed on trunk
Fa0/1 1-1005
Port Vlans allowed and active in management domain
Fa0/1 1,10,20,30,99,1002,1003,1004,1005
Port Vlans in spanning tree forwarding state and not pruned
Fa0/1 1,10,20,30,99,1002,1003,1004,1005