記得在上一家公司時,出現過交換機突然重新開機了,配置檔案也消失了,是以導緻一系列問題等。後來通過查問同僚找到了原因,是因為交換機的MODE鍵抵住了機架,導緻重新開機。而通過按住交換機前面闆的MODE鍵10s後交換機會将配置檔案清除,然後重新開機,也就是說恢複到出廠狀态。後來通過查找cisco文檔發現有一條指令可以解決這個問題。
全局模式指令:no setup express
解釋:
When Express Setup is enabled on a new (unconfigured) switch, pressing the Mode button for 3 seconds
activates Express Setup. You can access the switch through an Ethernet port by using the IP address
10.0.0.1 and then can configure the switch with the web-based Express Setup program or the CLI-based
setup program.
When you press the Mode button for 3 seconds on a configured switch, the mode LEDs start flashing. If
you press the Mode button for a total of 10 seconds, the switch configuration is deleted, and the switch
reboots. The switch can then be configured like a new switch, either through the web-based Express
Setup program or the CLI-based setup program.
......
The primary purpose of the no setup express command is to prevent someone from deleting the switch
configuration by pressing the Mode button for 10 seconds.
不過同時想到了另外一個問題:交換機做密碼恢複時需要使用到這個MODE鍵,如果在交換機上面配置“no setup express”後,會不會導緻不能進行密碼恢複了呢?于是我今天針對這個問題做了一個實驗,答案是使用“no setup express”指令與交換機密碼恢複不沖突。
下面介紹一下交換機密碼恢複過程:
1,按住MODE鍵(大概10s)同時啟動電源,在發現SYST燈經過一段時間閃動後,突然變成黃色,然後馬上就變成綠色不閃爍,這個時候松開MODE鍵;
2,終端上面會出現如下界面:

3,輸入“flash_init”指令,初始化後再輸入“dir flash:”指令,顯示如下:
4,輸入“rename flash:/config.text flash:/config.text.renamed”,結果如下:
需要注意的是:有可能當你輸入上述指令後,系統會提示錯誤資訊,重新輸入就可以了。這個問題我碰到過很多次。
5,然後重新開機交換機,指令:boot
注意:這個模式下可以通過“help”指令來檢視指令。
6,重新開機後進入系統,這是show run指令檢視出來的是初始化配置,是以需要重命名flash:/config.text.renamed檔案,指令:<b>rename flash:</b>config.text.renamed <b>flash:</b>config.text;
7,将<b>flash:</b>config.text拷貝到記憶體中,指令:<b>copy flash:</b>config.text <b>system:</b>running-config;
8,這個時候就可以修改密碼了,然後儲存就行了。
總結:為了解決交換機通過mode重新開機導緻配置丢失的問題,可以在交換機上面配置"no setup express"指令,這個指令與交換機密碼恢複沒有沖突。
本文轉自 chris_lee 51CTO部落格,原文連結:http://blog.51cto.com/ipneter/92233,如需轉載請自行聯系原作者