萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 網路安全 >  >> 路由器知識 >> 路由器設定 >> Cisco 思科路由器

思科路由器核心命令分類速查:顯示、幫助、模式切換與基礎配置指令

思科 IOS 指令數量龐大,掌握分類體系與高頻指令是網管效率的關鍵。本文將常用命令歸類為五大類,並附上模式切換速查表,方便日常操作與考試複習。

一、五大命令分類

分類用途代表指令
顯示命令查看運行狀態、統計、鄰居、路由表、介面計數器等show running-config、show ip route、show interfaces、show version、show cdp neighbors
幫助命令任意模式輸入 ? 取得語法提示、關鍵字列表、參數說明?、command ?、command keyword ?
模式切換命令在用戶/特權/全域/介面/線路/路由協議等模式間切換enable、disable、configure terminal、interface、line、router、exit、end
配置/修改命令實際修改設備行為:IP、路由、ACL、QoS、安全、管理等ip address、ip route、access-list、username、enable secret
基礎工具命令連通性測試、檔案管理、升級、除錯、時間同步ping、traceroute、copy、archive、debug、ntp

二、模式層級與提示符對照

提示符模式名稱進入指令退出指令典型任務
Router>用戶執行模式登入預設exit/logoutPing、Telnet、查看非敏感資訊
Router#特權執行模式enabledisable所有 show、debug、copy、檔案系統、進入配置模式
Router(config)#全域配置模式configure terminalend/Ctrl-Z主機名、密碼、IP 路由、VLAN、SNMP、AAA 等全域參數
Router(config-if)#介面配置模式interface exitIP/掩碼、封裝、頻寬、ACL、Port-channel、HSRP
Router(config-line)#線路配置模式line console/vty/aux exit密碼、傳輸協定、逾時、登入認證方式
Router(config-router)#路由協議配置router ospf/eigrp/rip exit網路宣告、區域、度量、重發佈、鄰居認證
rommon>ROM Monitor開機 Ctrl+Breakreset/bootIOS 災難恢復、修改配置暫存器、Xmodem 載入

三、高頻顯示指令速查卡

! 系統資訊
show version              ! IOS 版本、硬體、記憶體、配置暫存器、啟動映像
show inventory            ! 模組序號、PID、VID、SN(申請 SmartNet 必備)
show processes cpu history! CPU 歷史走勢圖 (60秒/60分/72時)
show memory statistics    ! 記憶體碎片、可用、最低水位

! 配置備份與比對
show running-config       ! 當前運行配置
show startup-config       ! NVRAM 開機配置
show archive config differences nvram:startup-config system:running-config ! 差異比對

! 介面與連結
show ip interface brief   ! 所有介面 IP/狀態/協定 一行摘要
show interfaces [id]      ! 詳細計數器、錯誤、MTU、封裝、隊列
show controllers [id]     ! 物理層控制器狀態 (T1/E1/DSL/Serial)

! 路由與轉發
show ip route             ! 路由表
show ip route     ! 特定前綴最長匹配路徑
show ip cef       ! CEF 轉發資訊基底 (FIB/Adjacency)
show ip protocols         ! 動態路由協議參數、計時器、重發佈

! 鄰居與發現
show cdp neighbors detail ! 直接相連思科設備詳細資訊
show lldp neighbors       ! 多廠商鄰居發現 (需啟用 lldp run)

! 安全與存取
show access-lists         ! ACL 匹配計數
show logging              ! 緩衝區日誌
show ssh                  ! SSH 會話狀態
show users                ! 當前 VTY/Console 連線用戶

四、檔案系統與升級核心指令

dir flash:                ! 列出檔案系統內容
copy running-config startup-config   ! 存檔 (wr)
copy running-config tftp://1.1.1.1/backup.cfg  ! 遠端備份
copy tftp://1.1.1.1/c2900-universalk9-mz.SPA.152-4.M5.bin flash:  ! IOS 升級
archive download-sw /overwrite /reload tftp://1.1.1.1/...tar       ! 交換機自動解壓升級
verify /md5 flash:xxx.bin  ! 校驗完整性

五、除錯與診斷原則

  • debug 指令極度消耗 CPU,嚴禁生產環境長時間開啟。
  • 使用 debug condition interface 或 debug condition ip 限制範圍。
  • 必須搭配 terminal monitor (VTY) 將訊息導向終端機,並開啟 logging buffered 存檔。
  • 結束除錯:undebug all 或 no debug all。

將上述指令整理為個人速查卡(或匯入 Anki/Notion),配合實驗環境反覆練習,即可建立扎實的 IOS 操作肌肉記憶。

copyright © 萬盛學電腦網 all rights reserved