交換機命令

alSwitch(con alSwitch(con alSwitch(con

基本內容

請問你是什麼牌?H3C Switch命令:

一、模式命令:

1. 用戶模式:Switch>

2. 特權模式:Switch>enable

Switch#

3. 全局配置模式:Switch#config terminal

Switch(config)#

4. 接口配置模式:Switch(config)#interface fastethernet0/1

Switch(config-if)#

5. Line模式:Switch(config)#line console 0

Switch(config-line)#

二、特權模式下的命令:

1. 查看機MAC地址:Switch#show mac-address-table

2. 發現(CDP):

Switch#show cdp

Switch#show cdp interface fastethernet0/1

Switch#show cdp neighbors

Switch#show cdp neighbors detail

Switch#show cdp entry

3. 保存機配置:

Switch#copy running-config startup-config或者Switch#write

4. 恢復交換機出廠值:

Switch#erase startup-config

Switch#reload

三、全局配置模式下的命令:

1. 配置主機名:Switch(config)#hostname Sw1

Sw1(config)#

2、 設定登入台密碼:Switch(config)#line console 0

Switch(config-line)#password 密碼

Switch(config-line)#login

3. 使能口令:Switch(config)#enable Password 密碼

4. 加密保存的使能口令:Switch(config)#enable secret 密碼

5. 配置IP位址:

Switch(config)#interface vlan 1

Switch(config-if)#ip address IP位址 網關

Switch(config-if)#no shutdown

6. 配置交換機網關:Switch(config)#ip default-gateway 網關

四、VLAN配置命令:

1. 創建vlan命令:

a) 全局配置模式下:

Switch(config)#vlan 2

Switch(config)#name v2

Switch(config)#mtu 數值

Switch(config)#end

b) Vlan資料庫下:

Switch#vlan database

Switch#vlan 2 name v2

Switch#vlan 2 mut 數值

Switch#exit

2. 刪除vlan命令:

a) 全局配置模式下:

Switch(config)#no vlan 2

Switch(config)#end

b) Vlan資料庫下:

Switch#no vlan 2 name v2

Switch#exit

3. 在vlan中添加連線埠:

Switch#config terminal

Switch(config)#interface f0/1(連線埠)

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 2

Switch(config-if)#end

一次將多個連線埠添加到vlan中:

Switch#config terminal

Switch(config)#interface range f0/1 - 5(連線埠)

Switch(config-if)#switchport access vlan 2

Switch(config-if)#end

註:switch#show vlan biref(查看vlan信息)

4. 配置VLAN Trunk:

1. 配置接口為trunk命令:

Switch(config)# interface f0/1(連線埠)

Switch(config-if)#Switchport mode trunk

2. 配置接口為動態協商模式的命令:

Switch(config)# interface f0/1(連線埠)

Switch(config-if)#switchport mode dynamic desirable/auto

3. 從trunk中刪除vlan:

Switch(config)# interface f0/1(連線埠)

Switch(config-if)#Switchport trunk allowed vlan remove 2

4. 在trunk中添加vlan:

Switch(config)# interface f0/1(連線埠)

Switch(config-if)#Switchport trunk allowed vlan add 2

-----------------------------------------------------------

Catalyst 2950交換機密碼恢復

(1)拔下交換機的電源。

(2)用手按再交換機的MODE按鍵上,插上電源線。

(3)看到控制台出現如下提示,鬆開MODE建。

switch:

(4)再switch:後執行flash_init命令。

(5)查看Flash中的檔案。

(6)把config.text檔案改名為config.old檔案。

(7)執行boot命令,啟動交換機。

(8)進入特權模式查看flash里的檔案。

(9)把檔案config.old改為config.text檔案。

(10)把config.text複製為系統的running-config.

(11)進入配置模式重新設定密碼並存檔,密碼恢復完成。

熱門詞條

聯絡我們