排查連線故障、確認速率雙工、統計錯誤計數器,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 protocol | up | down = 二層協議異常 (封裝不匹配、VLAN 不通、對端 shutdown) |
| Interface | up | down = 物理鏈路斷開 (線纜、光模塊、對端關閉) |
| Duplex/Speed | Full-duplex, 100Mb/s | Half-duplex 或速率不符 = 雙工不匹配 → 大量 collision/CRC error |
| Input errors / CRC | 0 | 遞增 = 線纜劣化、模塊故障、雙工不匹配 |
| Output errors / Collisions | 0 | Half-duplex 下 collision 正常,Full-duplex 下 >0 即異常 |
| Runts / Giants | 0 | 封包過小/過大,通常伴隨 CRC 錯誤 |
| Last clearing | never | 定期 clear counters 便於觀察增量 |
show interface status:所有介面狀態、VLAN、速率、雙工一覽表。show interface counters errors:僅顯示錯誤計數器。show interface description:介面描述與狀態。show interface | include (up|down):過濾輸出。sh int status 快速定位異常介面 (err-disabled、notconnect、half)。sh int fa0/x 看錯誤計數器、雙工/速率。sh errdisable recovery 查原因 (BPDU guard、security violation、link-flap),修正後 shutdown/no shutdown 恢復。clear counters int fa0/x 歸零,觀察增量趨勢。熟讀 show interface 輸出,是網管從「會配置」進階到「會排錯」的分水嶺。