思科设备交换机vlantrunk配置.docx
《思科设备交换机vlantrunk配置.docx》由会员分享,可在线阅读,更多相关《思科设备交换机vlantrunk配置.docx(7页珍藏版)》请在冰豆网上搜索。
思科设备交换机vlantrunk配置
思科设备交换机vlan-trunk配置
本次讲解vlantrunk配置方法:
本例配置模型图
命令行:
以下为switchA配置:
Switch>
Switch>enable
Switch#vlandatabase
%Warning:
ItisrecommendedtoconfigureVLANfromconfigmode,
asVLANdatabasemodeisbeingdeprecated.
Fa0/15,Fa0/16,Fa0/17,Fa0/18
Fa0/19,Fa0/20,Fa0/21,Fa0/22
Fa0/23,Fa0/24,Gig1/1,Gig1/2
2TztAactiveFa0/1
3TztBactiveFa0/2
1002fddi-defaultact/unsup
1003token-ring-defaultact/unsup
1004fddinet-defaultact/unsup
1005trnet-defaultact/unsup
VLANTypeSAIDMTUParentRingNoBridgeNoStpBrdgModeTrans1Trans2
--------------------------------------------------------------------
1enet1000011500-----00
2enet1000021500-----00
3enet1000031500-----00
1002fddi1010021500-----00
1003tr1010031500-----00
1004fdnet1010041500---ieee-00
1005trnet1010051500---ibm-00
RemoteSPANVLANs
------------------------------------------------------------------------------
PrimarySecondaryTypePorts
---------------------------------------------------------------------------
Switch#wr
Buildingconfiguration...
[OK]
Switch#conft
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
Switch(config)#intg1/1//进入端口g1/1配置vlantrunk模式
Switch(config-if)#swtrunkenca
Switch(config-if)#swtrunkallowedvlanall//配置允许所有vlan通过switchA
Switch(config-if)#exit
Switch(config)#exit
Switch#
Switch#wr//保存已有配置
Buildingconfiguration...
[OK]
Switch#
以下为switchB配置:
Switch>enable
Switch#vlandatabase
%Warning:
ItisrecommendedtoconfigureVLANfromconfigmode,
asVLANdatabasemodeisbeingdeprecated.Pleaseconsultuser
documentationforconfiguringVTP/VLANinconfigmode.
Switch(vlan)#vlan2nameTztA
VLAN2added:
Name:
TztA
Switch(vlan)#vlan3nameTztB
VLAN3added:
Name:
TztB
Switch(vlan)#exit
APPLYcompleted.
Exiting....
Switch#configt
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
Switch(config)#intf0/1
Switch(config-if)#swmoacc
Switch(config-if)#swaccvlan2
Switch(config-if)#intf0/2
Switch(config-if)#swmoacc
Switch(config-if)#swaccvlan3
Switch(config-if)#exit
Switch(config)#showvlan
^
%Invalidinputdetectedat'^'marker.
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I:
Configuredfromconsolebyconsole
Switch#showvlan//显示所有vlan配置信息
VLANNameStatusPorts
----------------------------------------------------------------------------
1defaultactiveFa0/3,Fa0/4,Fa0/5,Fa0/6
Fa0/7,Fa0/8,Fa0/9,Fa0/10
Fa0/11,Fa0/12,Fa0/13,Fa0/14
Fa0/15,Fa0/16,Fa0/17,Fa0/18
Fa0/19,Fa0/20,Fa0/21,Fa0/22
Fa0/23,Fa0/24,Gig1/1,Gig1/2
2TztAactiveFa0/1
3TztBactiveFa0/2
1002fddi-defaultact/unsup
1003token-ring-defaultact/unsup
1004fddinet-defaultact/unsup
1005trnet-defaultact/unsup
VLANTypeSAIDMTUParentRingNoBridgeNoStpBrdgModeTrans1Trans2
--------------------------------------------------------------------
1enet1000011500-----00
2enet1000021500-----00
3enet1000031500-----00
1002fddi1010021500-----00
1003tr1010031500-----00
1004fdnet1010041500---ieee-00
1005trnet1010051500---ibm-00
RemoteSPANVLANs
------------------------------------------------------------------------------
PrimarySecondaryTypePorts
---------------------------------------------------------------------------
Switch#conft
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
Switch(config)#intg1/1
Switch(config-if)#switchportmodetrunk
Switch(config-if)#
%LINEPROTO-5-UPDOWN:
LineprotocolonInterfaceGigabitEthernet1/1,changedstatetodown
%LINEPROTO-5-UPDOWN:
LineprotocolonInterfaceGigabitEthernet1/1,changedstatetoup
Switch(config-if)#switchporttrunkallowedvlanall
Switch(config-if)#exit
Switch(config)#
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I:
Configuredfromconsolebyconsole
wr
Buildingconfiguration...
[OK]
Switch#
注:
模型图中客户端电脑IP已自行设定!
讲解结束!