交换机(Switch)VLAN划分、删除、VLAN Trunk的配置.docx
文本预览下载声明
制作者:追风的人
PAGE4 / NUMPAGES4
一、在SwA上分别创建VLAN2和VLAN3,并把端口划归相应的VLAN
Switchenable //进入特权模式
Switch#vlan database //进入vlan配置模式
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
Switch(vlan)#vlan 2 name NetA //划分vlan 2名称为NetA
VLAN 2 added:
Name: NetA
Switch(vlan)#vlan 3 name NetB //划分vlan 3名称为NetB
VLAN 3 added:
Name: NetB
Switch(vlan)#exit
APPLY completed.
Exiting
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/1 //进入交换机的Fastethernet0/1接口
Switch(config-if)#switchport mode access //配置成接入模式
Switch(config-if)#switchport access vlan 2 //将vlan 划分到Fastethernet0/1接口
Switch(config-if)#exit
Switch(config)#int f0/3 //同上
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 3
Switch(config-if)#end
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#wr //保存当前配置
Building configuration...
[OK]
Switch#
二、对SwB划分VLAN2和VLAN3,并划归相应端口。(同上SwA配置方式一样)
Switchena
Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
Switch(vlan)#vlan 2 name NetA
VLAN 2 added:
Name: NetA
Switch(vlan)#vlan 3 name NetB
VLAN 3 added:
Name: NetB
Switch(vlan)#exit
APPLY completed.
Exiting
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/2
Switch(config-if)#swi
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 2
Switch(config-if)#int f0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 4
% Access VLAN does not exist. Creating vlan 4
Switch(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Switch#wr
Building configuration...
[OK]
Switch#
三、分别把两个交换机的f0/10端口配置成Trunk端口,并允许所有VLAN
显示全部