------------------------------------------------------------------------------------------------------
簡介
------------------------------------------------------------------------------------------------------

Ethtool 是一支用來查詢與設置Linux系統中網卡參數的工具程式


------------------------------------------------------------------------------------------------------
取得與安裝
------------------------------------------------------------------------------------------------------

[取得ethtool-6]

    Source URL: http://linux.softpedia.com/progDownload/ethtool-Download-14252.html

[編譯ethtool]

    <linux PC>
            tar -zxvf ethtool-6.tar.gz
            cd ethtool-6/
            ./configure
            make
            make install

    <Embed system>
           tar -zxvf ethtool-6.tar.gz
           cd ethtool-6/
           ./configure CC=/usr/local/toolchain_mipsel/bin/mipsel-linux-gcc CFLAGS=-static --host=mipsel-linux
           make


------------------------------------------------------------------------------------------------------
指令:
------------------------------------------------------------------------------------------------------
* ethtool  <ethx>  查詢網路介面卡 ethx的參數

  # ethtool eth0
  Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: Yes  // Auto Negoation Enabled
        Speed: 100Mb/s   // 100Mbps
        Duplex: Full    // Full Duplex mode
        Port: MII    // MII port
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000007 (7)
        Link detected: yes   // 已經連線

------------------------------------------------------------------------------------------------------
* ethtool -i  <ethx>   查詢網路介面卡 ethx的相關訊息

# ./ethtool -i eth0
      driver: 8139cplus  
      version: 1.2  
      firmware-version:
      bus-info:

------------------------------------------------------------------------------------------------------
* ethtool -e  <ethx>  查詢網路介面卡 ethx的註冊訊息

------------------------------------------------------------------------------------------------------
* ethtool -S  <ethx>   查詢網路介面卡 ethx的統計資訊

  ex:# ethtool -S eth0

  NIC statistics:
     tx_ok: 297
     rx_ok: 3213
     tx_err: 0
     rx_err: 0
     rx_fifo: 0
     frame_align: 0
     tx_ok_1col: 0
     tx_ok_mcol: 0
     rx_ok_phys: 3168
     rx_ok_bcast: 45
     rx_ok_mcast: 0
     tx_abort: 0
     tx_underrun: 0
     rx_frags: 0

------------------------------------------------------------------------------------------------------
* ethtool -s  <ethx> [options...] 設定網路介面卡ethx的相關參數

  options:

        speed [10 / 100 / 1000]: operation speed
 10 : 10 Mbps
 100: 100Mbps
 1000: 1000Mbps

        duplex [half | full] : duplex mode
 half: 半雙工
 full: 全雙工
      
        autoneg [on|off] : 是否啟用自動速率協商

        port [tp|aui|bnc|mii] : 網路接口類型
------------------------------------------------------------------------------------------------------ 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 kaivy2001 的頭像
    kaivy2001

    K的生活札記

    kaivy2001 發表在 痞客邦 留言(0) 人氣()