cisco(思科)交換機配置篇 兩

2021-09-08 22:18:40 字數 4928 閱讀 5101

1、進入全域性配置模式:

switch#configure terminal 

enter configuration commands, one per line. end with cntl/z.

switch(config)#

switch(config)#

switch(config)#

2、改動port描寫敘述

switch#

switch#

switch#conf ter

enter configuration commands, one per line. end with cntl/z.

switch(config)#

switch(config)#int fa0/3

switch(config-if)#

switch(config-if)#desc

switch(config-if)#description updatedesc

switch(config-if)#

switch(config-if)#exit

switch(config)#exit

switch#

switch#show inter

switch#show inte***ces statu

switch#show inte***ces status

port name status vlan duplex speed type

fa0/1 connected 1 a-full a-100 10/100basetx

fa0/2 h3c2.250 connected trunk a-full a-100 10/100basetx

fa0/3 updatedesc notconnect 1 auto auto 10/100basetx

fa0/4 connected 1 a-full a-100 10/100basetx

fa0/5 h3c-2.200 connected 1 a-full a-100 10/100basetx

fa0/6 notconnect 1 auto auto 10/100basetx

改動描寫敘述的關鍵命令在於,在配置模式下。進入到要改動的port下,然後使用description + 「內容」。效果應該非常直觀了吧。接下來就是改動port的所在vlan了

3、改動portvlan

switch#

switch#

switch#conf t

enter configuration commands, one per line. end with cntl/z.

switch(config)#

switch(config)#int fa0/3

switch(config-if)#

switch(config-if)#sw acc vl 2

switch(config-if)#

switch(config-if)#exit

switch(config)#

switch(config)#exit

switch#

switch#show inter statu

port name status vlan duplex speed type

fa0/1 connected 1 a-full a-100 10/100basetx

fa0/2 h3c2.250 connected trunk a-full a-100 10/100basetx

fa0/3 updatedesc notconnect 2 auto auto 10/100basetx

fa0/4 connected 1 a-full a-100 10/100basetx

fa0/5 h3c-2.200 connected 1 a-full a-100 10/100basetx

fa0/6 notconnect 1 auto auto 10/100basetx

邏輯和改動port描寫敘述是一樣的,對於配置來說,肯定是到了能有配置許可權的地方和要配置的物件。這裡改動portvlan的關鍵命令為:sw acc vl + vlantag,命令非常明顯被簡寫了,可是不影響執行。命令的全寫為:switchport access vlan + vlantag

另一些對port的簡單操作,譬如改動port的模式,

4、改動port模式

switch(config-if)#switchport trunk encap dot1q ----------------設定vlan 中繼的封裝協議

注:dot1q就是 ieee 802.1q協議,是vlan的一種封裝方式,是公有協議。

另一種trunk協議,是isl,也是vlan的一種封裝方式,只是這是cisco思科私有協議。其它廠商不能用。 switch(config-if)#switchport mode trunk ------------------------設定埠型別為trunk switch(config-if)#switchport trunk allowed vlan 1。2 ---------設定同意的vlan。預設不用配置。為全部vlan switch(config-if)#switchport trun native vlan 999 ---------------設定trunk口的native vlan

5、port狀態

switch(config)#

switch(config)#int fa0/3

switch(config-if)#

switch(config-if)#

switch(config-if)#sw acc vl 1

switch(config-if)#

switch(config-if)#

switch(config-if)#shutd

switch(config-if)#shutdown

switch(config-if)#

switch(config-if)#exit

switch(config)#

switch(config)#exit

switch#

switch#show inter statu

port name status vlan duplex speed type

fa0/1 connected 1 a-full a-100 10/100basetx

fa0/2 h3c2.250 connected trunk a-full a-100 10/100basetx

fa0/3 updatedesc disabled 1 auto auto 10/100basetx

fa0/4 connected 1 a-full a-100 10/100basetx

上面的一系列為切換vlan,而且shutdownport,這時候大家可能看到了交換機3號port的狀態已變成disable了,假設我們要啟用port僅僅需

switch#conf t

enter configuration commands, one per line. end with cntl/z.

switch(config)#

switch(config)#int fa0/3

switch(config-if)#

switch(config-if)#no shut

switch(config-if)#no shutdown

switch(config-if)#

switch(config-if)#exit

switch(config)#

switch(config)#exit

switch#

switch#show inter statu

port name status vlan duplex speed type

fa0/1 connected 1 a-full a-100 10/100basetx

fa0/2 h3c2.250 connected trunk a-full a-100 10/100basetx

fa0/3 updatedesc notconnect 1 auto auto 10/100basetx

fa0/4 connected 1 a-full a-100 10/100basetx

思科交換機配置試題 思科交換機配置命令

思科交換機配置命令 簡寫命令 完整命令 使用者模式 使用者模式 switch switch 特權模式 特權模式 switch en switch enable switch switch 全域性配置模式 全域性配置模式 switch conf t switch config terminal swi...

cisco交換機配置

cisco交換機配置的幾個常用命令 switch enable 進入特權模式 switch conf t 進入配置模式 switch config int fa0 0 進入fa0 0介面 switch config if swichport mode trunk trunk介面配置 switch c...

思科(CISCO)交換機埠映象配置

思科 cisco 交換機配置映象 span 埠思科培訓機構 switch config monitor session 1 source inte ce fastethernet 4 10 switch config monitor session 1 filter vlan 57 switch c...