新手最易踩的坑:命令執行即時生效,但重啟後丟失。本文徹底講透 current-configuration 與 saved-configuration 的關係,以及三種保存/恢復場景。
| 文件 | 存儲位置 | 生效時機 | 重啟後 |
|---|---|---|---|
| current-configuration | 內存 (RAM) | 命令執行後立即 | 丟失 |
| saved-configuration | Flash (NVRAM) | 下次啟動時加載 | 保留 |
<HUAWEI> reboot
提示:The current configuration will be lost. Save? [Y/N] : N
選 N,設備重啟時從 Flash 讀取 saved-configuration 覆蓋內存,回滾到上次保存狀態。
<HUAWEI> save
The current configuration will be saved to the next startup saved-configuration. Continue? [Y/N] : Y
輸入 Y 確認,將當前內存配置寫入 Flash。此為最常用命令。
reboot + 選 N。save。save,養成肌肉記憶。save 當前穩定版本,再做實驗,失敗即 reboot 回滾。backup configuration to tftp://192.168.1.100/ar1220_20240101.cfg。「我沒輸入 save,但配置生效了,說明已經保存了。」
錯:只是生效在內存,掉電即失。生效 ≠ 保存。