ifconfig
命令主要用于配置和顯示網絡接口的參數,如 IP 地址、子網掩碼、廣播地址等。它并不能直接顯示網絡帶寬。但是,你可以使用 ethtool
命令來查看網絡接口的帶寬信息。
以下是如何使用 ethtool
查看網絡帶寬的步驟:
打開終端(Terminal)。
輸入以下命令,將 eth0
替換為你想要查看的網絡接口名稱:
ethtool eth0
例如,輸出可能類似于以下內容:
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: off (auto)
Supports Wake-on: g
Wake-on: d
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
在這個例子中,網絡接口 eth0
的速度為 1000Mb/s(即 1 Gbps),雙工模式為全雙工(Full)。