上一篇給大家講到了cisco交換機的基本操作命令,趁端午節放假前,把cisco交換機的簡(jiǎn)單配置分享一下并預祝一下各位“端午節快樂(lè )”!Ok,要進(jìn)行交換機的配置,首先就得進(jìn)入交換機的全局配置模式,在成功連接交換機并且登陸成功進(jìn)入特權模式下
1、輸入進(jìn)入全局配置模式:
switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z.switch(config)#switch(config)#switch(config)#這么簡(jiǎn)單的一條命令,俺們就進(jìn)入到全局配置模式了,還記得上一篇中查看端口所查詢(xún)到的信息中name字段下的值嗎?這字段其實(shí)代表的是交換機端口的描述信息
2、修改端口描述
switch#switch#switch#conf terEnter configuration commands, one per line. End with CNTL/Z.switch(config)#switch(config)#int fa0/3switch(config-if)#switch(config-if)#descswitch(config-if)#description updateDescswitch(config-if)#switch(config-if)#exitswitch(config)#exitswitch#switch#show interswitch#show interfaces statuswitch#show interfaces status Port Name Status Vlan Duplex Speed TypeFa0/1 connected 1 a-full a-100 10/100BaseTXFa0/2 h3c2.250 connected trunk a-full a-100 10/100BaseTXFa0/3 updateDesc notconnect 1 auto auto 10/100BaseTXFa0/4 connected 1 a-full a-100 10/100BaseTXFa0/5 h3c-2.200 connected 1 a-full a-100 10/100BaseTXFa0/6 notconnect 1 auto auto 10/100BaseTX
3、修改端口Vlan
switch#switch#switch#conf tEnter configuration commands, one per line. End with CNTL/Z.switch(config)#switch(config)#int fa0/3switch(config-if)#switch(config-if)#sw acc vl 2switch(config-if)#switch(config-if)#exitswitch(config)#switch(config)#exitswitch#switch#show inter statuPort Name Status Vlan Duplex Speed TypeFa0/1 connected 1 a-full a-100 10/100BaseTXFa0/2 h3c2.250 connected trunk a-full a-100 10/100BaseTXFa0/3 updateDesc notconnect 2 auto auto 10/100BaseTXFa0/4 connected 1 a-full a-100 10/100BaseTXFa0/5 h3c-2.200 connected 1 a-full a-100 10/100BaseTXFa0/6 notconnect 1 auto auto 10/100BaseTX
還有一些對端口的簡(jiǎn)單操作,譬如修改端口的模式,
4、修改端口模式
switch(config-if)#switchport trunk encap dot1q ----------------設置vlan 中繼的封裝協(xié)議注:dot1q就是 IEEE 802.1Q協(xié)議,是vlan的一種封裝方式,是公有協(xié)議。還有一種trunk協(xié)議,是ISL,也是vlan的一種封裝方式,不過(guò)這是Cisco思科私有協(xié)議,其他廠(chǎng)商不能用。switch(config-if)#switchport mode trunk ------------------------設置端口類(lèi)型為trunkswitch(config-if)#switchport trunk allowed vlan 1,2 ---------設置允許的vlan,默認不用配置,為所有vlanswitch(config-if)#switchport trun native vlan 999 ---------------設置trunk口的native vlan
switch(config)#switch(config)#int fa0/3switch(config-if)#switch(config-if)#switch(config-if)#sw acc vl 1switch(config-if)#switch(config-if)#switch(config-if)#shutd switch(config-if)#shutdown switch(config-if)# switch(config-if)#exitswitch(config)#switch(config)#exitswitch#switch#show inter statuPort Name Status Vlan Duplex Speed TypeFa0/1 connected 1 a-full a-100 10/100BaseTXFa0/2 h3c2.250 connected trunk a-full a-100 10/100BaseTXFa0/3 updateDesc disabled 1 auto auto 10/100BaseTXFa0/4 connected 1 a-full a-100 10/100BaseTX
switch#conf tEnter configuration commands, one per line. End with CNTL/Z.switch(config)#switch(config)#int fa0/3switch(config-if)#switch(config-if)#no shutswitch(config-if)#no shutdown switch(config-if)#switch(config-if)#exitswitch(config)#switch(config)#exitswitch#switch#show inter statuPort Name Status Vlan Duplex Speed TypeFa0/1 connected 1 a-full a-100 10/100BaseTXFa0/2 h3c2.250 connected trunk a-full a-100 10/100BaseTXFa0/3 updateDesc notconnect 1 auto auto 10/100BaseTXFa0/4 connected 1 a-full a-100 10/100BaseTX
聯(lián)系客服