萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 網路安全 >  >> 網路應用技術 >> 應用程式教學

思科路由器/交換機調試 5 步走:Console 線、超級終端、TFTP 備份、IOS 升級

硬體準備

  • Cisco Console 線 (藍色扁平線,RJ45 轉 DB9/USB)。
  • 電腦有串口 (DB9) 或 USB 轉串口驅動正常。
  • 終端模擬器:Windows 內建「超級終端」/ PuTTY / SecureCRT / Tera Term。
    參數:9600 8-N-1、無流控。

五步調試流程

  1. Console 連線 + 開機:Console 線連路由器 Console 口 + 電腦串口 → 通電開機 → 終端顯示啟動輸出 (POST、IOS 載入、配置載入)。
  2. 恢復出廠設定 (可選,慎用):
    Router> enable
    Router# erase startup-config
    Router# reload (確認不存盤) → 進入初始配置對話或空配置。
  3. 修改特權密碼:
    Router> enable
    Router# configure terminal
    Router(config)# enable secret StrongPass123! (加密存儲)
    Router(config)# line console 0
    Router(config-line)# password ConsolePass456!
    Router(config-line)# login
    Router(config-line)# exec-timeout 10 0 (10 分鐘無操作鎖定)
  4. TFTP 備份配置檔 / IOS 映像:
    電腦啟動 TFTP Server (如 Tftpd64),設定根目錄、允許寫入。
    路由器:
    Router# copy running-config tftp:///.cfg
    Router# copy flash:c2900-universalk9-mz.SPA.152-4.M5.bin tftp:///.bin
  5. IOS 升級 (如需):
    Router# copy tftp:///new-ios.bin flash:
    驗證 MD5/SHA256 → Router(config)# boot system flash:new-ios.bin → Router# reload。
    升級前必備份舊 IOS 與配置,確保電源穩定,不可中斷。

進階必會指令

show version           # 版本、運行時間、記憶體、介面、配置寄存器
show running-config    # 當前運行配置
show ip interface brief# 介面 IP/狀態一覽
show ip route          # 路由表
show logging           # 日誌
debug ...              # 慎用,高 CPU 風險
write memory / copy running-config startup-config  # 存盤

安全基線 (最小化)

  • no ip http server / no ip http secure-server (關閉 Web 管理) 或限 ACL。
  • service password-encryption (加密配置中明文密碼)。
  • login block-for 60 attempts 3 within 30 (登入失敗鎖定)。
  • banner motd # Authorized Access Only # (法律告示)。
  • aaa new-model + TACACS+/RADIUS 集中認證 (企業級)。
copyright © 萬盛學電腦網 all rights reserved