萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 程式設計 >  >> 伺服器教學

思科交換機查看單一介面詳細配置與狀態 (show interface)

排查連線故障、確認速率雙工、統計錯誤計數器,show interface 是思科交換機最核心的檢視指令。本文詳細解讀輸出關鍵欄位,並示範篩選特定介面資訊。

基本指令

Switch# show interface fastEthernet 0/1
# 縮寫
Switch# sh int fa0/1

輸出關鍵欄位解讀

FastEthernet0/1 is up, line protocol is up (connected)
  Hardware is Fast Ethernet, 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:00, 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 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     12345 packets input, 1234567 bytes, 0 no buffer
     Received 1234 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
     12345 packets output, 1234567 bytes, 0 underruns
     0 output errors, 0 collisions, 0 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

核心狀態判斷

欄位正常值異常含義
Line protocolupdown = 二層協議異常 (封裝不匹配、VLAN 不通、對端 shutdown)
Interfaceupdown = 物理鏈路斷開 (線纜、光模塊、對端關閉)
Duplex/SpeedFull-duplex, 100Mb/sHalf-duplex 或速率不符 = 雙工不匹配 → 大量 collision/CRC error
Input errors / CRC0遞增 = 線纜劣化、模塊故障、雙工不匹配
Output errors / Collisions0Half-duplex 下 collision 正常,Full-duplex 下 >0 即異常
Runts / Giants0封包過小/過大,通常伴隨 CRC 錯誤
Last clearingnever定期 clear counters 便於觀察增量

常用變體指令

  • show interface status:所有介面狀態、VLAN、速率、雙工一覽表。
  • show interface counters errors:僅顯示錯誤計數器。
  • show interface description:介面描述與狀態。
  • show interface | include (up|down):過濾輸出。

實戰排查流程

  1. sh int status 快速定位異常介面 (err-disabled、notconnect、half)。
  2. sh int fa0/x 看錯誤計數器、雙工/速率。
  3. 若 CRC/Input errors 遞增 → 換線纜、換模塊、強制雙工/速率。
  4. 若介面 err-disabled → sh errdisable recovery 查原因 (BPDU guard、security violation、link-flap),修正後 shutdown/no shutdown 恢復。
  5. 定期 clear counters int fa0/x 歸零,觀察增量趨勢。

熟讀 show interface 輸出,是網管從「會配置」進階到「會排錯」的分水嶺。

copyright © 萬盛學電腦網 all rights reserved