ilike86 2015-6-28 15:51
如何在 Linux 下查詢網卡資訊 - ethtool
如果你想在 Linux 下..查詢網卡的相關資訊...可以這樣做~<br><br>ethtool ethX //查詢ethX網口基本設置<br>ethtool –h //顯示ethtool的命令幫助(help)<br>ethtool –i ethX //查詢ethX網口的相關信息<br>ethtool –d ethX //查詢ethX網口註冊性信息<br>ethtool –r ethX //重置ethX網口到自適應模式<br>ethtool –S ethX //查詢ethX網口收發包統計<br>ethtool –s ethX [speed 10|100|1000]\ //設置網口速率10/100/1000M<br><br>舉例:<br>(1)[root@linux /]# <font color="Red">ethtool eth1</font><br>Settings for eth1:<br>Supported ports: [ TP ]<br>Supported link modes: 10baseT/Half 10baseT/Full<br>100baseT/Half 100baseT/Full<br>1000baseT/Full<br>Supports auto-negotiation: Yes<br>Advertised link modes: 10baseT/Half 10baseT/Full<br>100baseT/Half 100baseT/Full<br>1000baseT/Full<br>Advertised auto-negotiation: Yes<br>Speed: 1000Mb/s<br>Duplex: Full<br>Port: Twisted Pair<br>PHYAD: 0<br>Transceiver: internal<br>Auto-negotiation: on<br>Supports Wake-on: umbg<br>Wake-on: d<br>Link detected: yes<br><br>(2) [root@linux /]# <font color="Red">ethtool -i eth1</font><br>driver: e1000<br>version: 5.0.43-k1<br>firmware-version: N/A<br>bus-info: 06:08.1<br>3)[root@linux /]# ethtool -S eth1<br>NIC statistics:<br>rx_packets: 58068300<br>tx_packets: 87124083<br>rx_bytes: 1589713008<br>tx_bytes: 2165825901<br>rx_errors: 0<br>tx_errors: 0<br>rx_dropped: 0<br>tx_dropped: 0<br>multicast: 0<br>collisions: 0<br>rx_length_errors: 0<br>rx_over_errors: 0<br>rx_crc_errors: 0<br>rx_frame_errors: 0<br>rx_fifo_errors: 0<br>rx_missed_errors: 0<br>tx_aborted_errors: 0<br>tx_carrier_errors: 0<br>tx_fifo_errors: 0<br>tx_heartbeat_errors: 0<br>tx_window_errors: 0<br>4)[root@linux /]# ethtool -s eth1 autoneg off speed 100 duplex full<br><br>相關:<br>1)[root@linux /]# which ethtool<br>/sbin/ethtool<br>2)[root@linux /]# rpm -qf /sbin/ethtool<br>ethtool-1.6-5