目前对于Cisco设备的使用,网上的介绍材料因应有尽有,但是对Vlan和镜像方面的介绍总感觉不是特别满意,不是啰里啰唆,内容太多,晕倒新手,就是过于简略,也会让初学者无所收获——看完了无从下手,于是本人根据自己的配置过程,一步一步,手把手方式的介绍Cisco3550Vlan和镜像的配置过程,只要按照这些步骤操作,绝对没有问题
一、
Vlan配置
VLAN号1, 1002到1005是自动生成的不能被去掉。
案例:设置Vlan2,包含端口2~6。
1、Vlan配置
Step1: 进入Privilege-d
Exec模式
Switch>enable
Step2: 进入Global
Configura-tion 模式(进入配置状态)
Switch# conf
terminal
Enter configuration commands, one per line. End with
CNTL/Z.
Step3:创建Vlan,ID号为2
Switch(config)#vlan 2
Step4:命名Vlan2为PKF
Switch(config-vlan)#name PKF
Step5:退出Global
Configura-tion 模式
Switch(config)#end
2、将端口分配给Vlan
Step6:进入Global
Configura-tion 模式
Switch# conf terminal
Step7:进入要分配的端口2
Switch(config)#interface gigabitEthernet 0/2
Step8:定义二层口
Switch(config-if)#switchport mode access
Step9:把端口2分配给某一VLAN2
Switch(config-if)#switchport access vlan 2
Step10:退出Global
Configura-tion 模式
Switch(config-if)#end
Step11:循环6~10,分别将端口3~6分配给Vlan2
Step12:查看Vlan配置结果
Switch#show vlan
VLAN
Name
Status Ports
---- -------------------------------- ---------
-------------------------------
1
default
active Gi0/7, Gi0/8, Gi0/9, Gi0/10
Gi0/11, Gi0/12
2
PKF
active Gi0/2, Gi0/3, Gi0/4, Gi0/5
Gi0/6
1002
fddi-default
act/unsup
1003
token-ring-default
act/unsup
1004
fddinet-default
act/unsup
1005
trnet-default
act/unsup
VLAN Type SAID
MTU Parent RingNo BridgeNo Stp BrdgMode Trans1
Trans2
---- ----- ---------- ----- ------ ------ -------- ----
-------- ------ ------
1
enet 100001
1500 -
-
- -
-
0 0
2
enet 100002
1500 -
-
- -
-
0 0
1002 fddi 101002
1500 -
-
- -
- 0
0
1003 tr 101003
1500 -
-
- -
srb 0
0
1004 fdnet 101004
1500 -
-
1 ieee
-
0 0
1005 trnet 101005
1500 -
-
1
ibm -
0 0
Remote SPAN VLANs
------------------------------------------------------------------------------
Primary Secondary
Type
Ports
------- --------- -----------------
------------------------------------------
3、删除Vlan
Step1:进入Global
Configura-tion 模式
Switch#conf terminal
Step2:删除Vlan2
Switch(config)#no vlan 2
Step3:退出Global
Configura-tion 模式
Switch(config)#end
Step4:查看Vlan配置结果
Switch#show vlan
VLAN
Name
Status Ports
---- -------------------------------- ---------
-------------------------------
1
default
active Gi0/7, Gi0/8, Gi0/9, Gi0/10
Gi0/11, Gi0/12
1002
fddi-default
act/unsup
1003
token-ring-default
act/unsup
1004
fddinet-default
act/unsup
1005
trnet-default
act/unsup
VLAN Type SAID
MTU Parent RingNo BridgeNo Stp BrdgMode Trans1
Trans2
---- ----- ---------- ----- ------ ------ -------- ----
-------- ------ ------
1
enet 100001
1500 -
-
- -
-
0 0
1002 fddi 101002
1500 -
-
- -
-
0 0
1003 tr 101003
1500 -
-
- -
srb 0
0
1004 fdnet 101004
1500 -
- 1
ieee -
0 0
1005 trnet 101005
1500 -
-
1
ibm -
0 0
Remote SPAN VLANs
------------------------------------------------------------------------------
Primary Secondary
Type
Ports
------- --------- -----------------
------------------------------------------
二、镜像口配置
Cisco3550可以配置2个镜像口
案例:将端口2~5镜像到端口6
1、镜像口配置
Step1: 进入Privilege-d
Exec模式
Switch>enable
Step2: 进入Global
Configura-tion 模式
Switch#conf t
Enter configuration commands, one per line. End with
CNTL/Z.
Step3: 配置镜像源,可以是端口也可以是Vlan
Switch(config)#monitor session 1 source interface
gigabitEthernet 0/2 - 5 rx
Step4: 配置镜像目的端口
Switch(config)#monitor session 1 destination interface
gigabitEthernet 0/6
Step5: 退出Global
Configura-tion模式
Switch(config)#end
Step6:保存配置
Switch#wr
Step7:查看配置结果
Switch#show monitor
Session 1
---------
Type
: Local Session
Source Ports
:
RX
Only : Gi0/2-5
Destination Ports : Gi0/6
Encapsulation : Native
Ingress : Disabled
2、删除镜像端口
Step1:进入Global
Configura-tion 模式
Switch#conf t
Enter configuration commands, one per line. End with
CNTL/Z.
Step2:删除镜像端口
Switch(config)#no monitor session 1
Step3:退出Global
Configura-tion 模式
Switch(config)#end
Step4:保存配置
Switch#wr
Step5:查看结果
Switch#show monitor
No SPAN configuration is present in the system.