萬盛學電腦網

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

善用 Cisco IOS 指令快速診斷乙太網介面故障:show version / show interface 實戰判讀

網路中斷時,乙太網介面故障是高頻嫌疑點。Cisco IOS 內建 show version 與 show interface 兩大核心指令,能在幾秒內判斷是「物理層損壞」還是「配置/邏輯層問題」,避免盲目換線、換模組。本文建立標準化診斷流程與判讀對照表。

診斷流程圖 (文字版)


疑似乙太網故障
      │
      ▼
show version  ──► 介面是否出現在列表? ──否──► 物理損壞/模組未就位 ──► 換模組/換設備
      │                                            │
      是                                           ▼
      ▼                                    show interface 
      │                                    │
      ▼                                    ▼
show interface   ◄─────────────────  觀察 Line/Protocol 狀態組合
      │
      ▼
對照狀態組合表採取對應動作

一、第一關:show version 確認物理介面存在性

Router# show version
...
2 FastEthernet/IEEE 802.3 interface(s)
1 GigabitEthernet/IEEE 802.3 interface(s)
2 Serial(sync/async) interface(s)
...
  • 輸出清單**僅列出硬體偵測通過**的介面控制器。
  • 若目標介面 (如 FastEthernet0/1) **完全不在列表中** → 物理層故障:模組未就位、插槽損壞、模組故障、不支援該模組的機型。
  • 對策:重插模組 → 換插槽 → 換已知良品模組 → 聯繫 Cisco TAC / RMA。
  • 若介面在列表中 → 進入第二關。

二、第二關:show interface 判讀 Line/Protocol 狀態組合

Line StatusProtocol Status含義典型原因對策
UpUp正常通訊—無需處理
UpDown實體連結正常,封裝/協定不匹配對端 shutdown、封裝不同 (HDLC/PPP/Frame Relay)、IP 子網不匹配、ACL 阻擋、Keepalive 失敗檢查對端介面狀態、封裝、IP、ACL、keepalive 設定
DownDown實體連結斷開網線斷/鬆、對端關機/關介面、光模組故障、速率/雙工不匹配、MDI/MDIX 錯誤檢查線序、對端燈號、speed/duplex auto、換線/換模組
Administratively DownDown介面被管理員手動關閉配置 shutdownno shutdown 啟用介面
UpUp (Err-Disabled)錯誤禁用狀態Port-security 違規、UDLD 雙向檢測失敗、STP Loop Guard、Link Flapshow interfaces status err-disabled 查看原因 → 修正根因 → shutdown/no shutdown 或 errdisable recovery

三、關鍵計數器深度診斷

Router# show interfaces FastEthernet0/0
FastEthernet0/0 is up, line protocol is up
  Hardware is AmdFE, address is 001a.2b3c.4d5e (bia 001a.2b3c.4d5e)
  MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 100Mb/s, media type is 10/100BaseTX
  input flow-control is off, output flow-control is off
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:01, output 00:00:00, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 1000 bits/sec, 2 packets/sec
  5 minute output rate 2000 bits/sec, 3 packets/sec
     123456 packets input, 12345678 bytes, 0 no buffer
     Received 12345 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog, 0 multicast, 0 pause input
     123456 packets output, 12345678 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 unknown protocol drops
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier, 0 pause output
     0 output buffer failures, 0 output buffers swapped out

重點計數器異常判讀:

  • CRC / Frame / Overrun / Ignored > 0:物理層訊號品質差 (線材品質、長度超標、接頭氧化、電磁干擾)。
  • Collisions / Late Collision / Deferred > 0:半雙工衝突域過大、速率/雙工不匹配、線材過長。全雙工應為 0。
  • Runts / Giants:封包長度異常,通常伴隨 CRC 錯誤。
  • Input/Output Errors / Drops / Buffer Failures:擁塞、QoS 策略過嚴、硬體緩衝不足。
  • Carrier Transitions / Link Flaps:連結頻繁上下,檢查纜線、電源、對端設備。

四、常見人為操作失誤快速排查

  1. 誤下 shutdown:show running-config interface 檢查是否有 shutdown,執行 no shutdown。
  2. 速率/雙工硬碼不匹配:一端 speed 100 duplex full,另端 auto → 導致 duplex mismatch (大量 Collisions/CRC)。建議雙端同為 auto。
  3. VLAN/封裝錯誤:Trunk 未允許 VLAN、Access 埠 VLAN 錯誤、子介面封裝 encapsulation dot1Q VLAN ID 錯誤。
  4. Port-security 違規:show port-security interface 查看違規計數與動作 (shutdown/restrict/protect)。

五、標準化故障單模板


故障單編號: INC-20240115-001
時間: 2024-01-15 14:30
設備: Core-SW1 (10.1.1.1)
介面: GigabitEthernet1/0/24
現象: 伺服器斷網
執行指令:
  show version | include GigabitEthernet1/0/24   → 存在
  show interfaces Gi1/0/24                       → Up / Down
  show interfaces Gi1/0/24 counters errors       → CRC 1245, Frame 12
判斷: 物理層訊號品質差 (CRC/Frame 錯誤)
處理: 更換 Cat6a 跳線、清潔光模組/銅纜接頭、對端同步 auto/auto
結果: 介面 Up/Up,CRC 停止增長,業務恢復

建立「先查版本確認物理存在 → 再查介面狀態組合 → 再看計數器 → 最後查配置」的標準化診斷肌肉記憶,能將乙太網故障平均修復時間 (MTTR) 從 30 分鐘壓縮至 5 分鐘以內。

copyright © 萬盛學電腦網 all rights reserved