ethtool 工具使用手记

6004阅读 1评论2012-01-26 2007robot
分类:LINUX

      最近因为使用LINUX,之前一直比较习惯Fedora,用其开发项目,可是有一天碰到了一个问题,就是其时不时的断网,因为项目在断网情况下绝对是无法完成的,后来就下载了Ubuntu,也就是目前使用的系统。因为需要查看我的机子的网卡的驱动,所以偶然在网上看到有ethtool这个工具,ethtool 是用于查询及设置网卡参数的工具,所以认真的记录一下使用过程,作个笔记和大家伙分享一下。
使用概要:
ethtool –h     //显示ethtool的帮助信息。

kevin@kevin-Presario-V3700-Notebook-PC:/$ ethtool -h
ethtool version 2.6.39
Usage:
        ethtool DEVNAME    Display standard information about device
        ethtool -s|--change DEVNAME    Change generic options
        [ speed %d ]
        [ duplex half|full ]
        [ port tp|aui|bnc|mii|fibre ]
        [ autoneg on|off ]
        [ advertise %x ]
        [ phyad %d ]
        [ xcvr internal|external ]
        [ wol p|u|m|b|a|g|s|d... ]
        [ sopass %x:%x:%x:%x:%x:%x ]
        [ msglvl %d | msglvl type on|off ... ]
        ethtool -a|--show-pause DEVNAME    Show pause options
        ethtool -A|--pause DEVNAME    Set pause options

ethtool ethx         //查询ethx网卡的基本设置,其中 x 是对应网卡的编号,如eth0、eth1等等。
                              // 因为我的机子是有另外一块无线网卡的,无线网卡的名称是eth1。eth0是我机子的以太
                              //网卡,是10M/100M 全/半双工的。


ethtool –i eth0  //查询ethX网卡的驱动相关的信息。

kevin@kevin-Presario-V3700-Notebook-PC:/$ ethtool -i eth0
driver: sky2                      //可以看出其驱动名称为sky2
version: 1.28                    //版本号是1.28
firmware-version: N/A
bus-info: 0000:05:00.0
supports-statistics: yes
supports-test: no               // 是测试网卡是否可以自适应的,我的网卡不具备此功能,所以显示no。
supports-eeprom-access: yes
supports-register-dump: yes


ethtool -P eth0  //用于查询网卡eth0的硬件地址的。

       当然,该工具还有许多其它的使用功能,在这里只大略的讲一下,做个笔记,这个工具对于想了解网卡的一些信息十分有作用。

      本来是有一些图片的,不过CU编辑器好像不能直接贴图,所以就没弄上来。
上一篇:mini2440 移植linux2.6.30.10 及yaffs2文件系统
下一篇:一个C/C++通用Makefile

文章评论