ethtool命令
一、 簡介
??ethtool命令用于獲取以太網(wǎng)卡的配置信息筛严,或者修改這些配置醉旦。
二、 命令參數(shù)
-a 查看網(wǎng)卡中 接收模塊RX桨啃、發(fā)送模塊TX和Autonegotiate模塊的狀態(tài):啟動on 或 停用off车胡。
-A 修改網(wǎng)卡中 接收模塊RX、發(fā)送模塊TX和Autonegotiate模塊的狀態(tài):啟動on 或 停用off照瘾。
-c display the Coalesce information of the specified ethernet card匈棘。
-C Change the Coalesce setting of the specified ethernet card。
-g Display the rx/tx ring parameter information of the specified ethernet card析命。
-G change the rx/tx ring setting of the specified ethernet card主卫。
-i 顯示網(wǎng)卡驅(qū)動的信息逃默,如驅(qū)動的名稱、版本等队秩。
-d 顯示register dump信息, 部分網(wǎng)卡驅(qū)動不支持該選項笑旺。
-e 顯示EEPROM dump信息,部分網(wǎng)卡驅(qū)動不支持該選項馍资。
-E 修改網(wǎng)卡EEPROM byte筒主。
-k 顯示網(wǎng)卡Offload參數(shù)的狀態(tài):on 或 off,包括rx-checksumming鸟蟹、tx-checksumming等乌妙。
-K 修改網(wǎng)卡Offload參數(shù)的狀態(tài)。
-p 用于區(qū)別不同ethX對應(yīng)網(wǎng)卡的物理位置建钥,常用的方法是使網(wǎng)卡port上的led不斷的閃藤韵;N指示了網(wǎng)卡閃的持續(xù)時間,以秒為單位熊经。
-r 如果auto-negotiation模塊的狀態(tài)為on泽艘,則restarts auto-negotiation。
-S 顯示NIC- and driver-specific 的統(tǒng)計參數(shù)镐依,如網(wǎng)卡接收/發(fā)送的字節(jié)數(shù)匹涮、接收/發(fā)送的廣播包個數(shù)等。
-t 讓網(wǎng)卡執(zhí)行自我檢測槐壳,有兩種模式:offline or online然低。
-s 修改網(wǎng)卡的部分配置,包括網(wǎng)卡速度务唐、單工/全雙工模式雳攘、mac地址等。
三枫笛、 命令使用
ethtool ethx //查詢ethx網(wǎng)口基本設(shè)置吨灭,其中 x 是對應(yīng)網(wǎng)卡的編號,如eth0刑巧、eth1等等
ethtool –h //顯示ethtool的命令幫助(help)
ethtool –i ethX //查詢ethX網(wǎng)口的相關(guān)信息
ethtool –d ethX //查詢ethX網(wǎng)口注冊性信息
ethtool –r ethX //重置ethX網(wǎng)口到自適應(yīng)模式
ethtool –S ethX //查詢ethX網(wǎng)口收發(fā)包統(tǒng)計
ethtool –s ethX [speed 10|100|1000] [duplex half|full] [autoneg on|off] //設(shè)置網(wǎng)口速率10/100/1000M沃于、設(shè)置網(wǎng)口半/全雙工、設(shè)置網(wǎng)口是否自協(xié)商
四海诲、 命令實例
1. 觀察eth0是哪個網(wǎng)卡口,使eth0的網(wǎng)卡led等閃爍10分鐘
[root@cxm ~]# ethtool -p eth0 600