ethtool命令手冊(cè)
ethtool:查詢及設(shè)置網(wǎng)卡參數(shù)
功能描述
ethtool 命令用于查詢及設(shè)置網(wǎng)卡參數(shù)。
命令語法
ethtool [選項(xiàng)] [網(wǎng)卡]
選項(xiàng)含義
-a 查看網(wǎng)卡中 接收模塊RX、發(fā)送模塊TX和Autonegotiate模塊的狀態(tài):?jiǎn)?dòng)on 或 停用off。
-A 修改網(wǎng)卡中 接收模塊RX、發(fā)送模塊TX和Autonegotiate模塊的狀態(tài):?jiǎn)?dòng)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ū)動(dòng)的信息,如驅(qū)動(dòng)的名稱、版本等。
-d 顯示register dump信息, 部分網(wǎng)卡驅(qū)動(dòng)不支持該選項(xiàng)。
-e 顯示EEPROM dump信息,部分網(wǎng)卡驅(qū)動(dòng)不支持該選項(xiàng)。
-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對(duì)應(yīng)網(wǎng)卡的物理位置,常用的方法是使網(wǎng)卡port上的led不斷的閃;N指示了網(wǎng)卡閃的持續(xù)時(shí)間,以秒為單位。
-r 如果auto-negotiation模塊的狀態(tài)為on,則restarts auto-negotiation。
-S 顯示NIC- and driver-specific 的統(tǒng)計(jì)參數(shù),如網(wǎng)卡接收/發(fā)送的字節(jié)數(shù)、接收/發(fā)送的廣播包個(gè)數(shù)等。
-t 讓網(wǎng)卡執(zhí)行自我檢測(cè),有兩種模式:offline or online。
-s 修改網(wǎng)卡的部分配置,包括網(wǎng)卡速度、單工/全雙工模式、mac地址等
參數(shù)實(shí)例
實(shí)例1
查詢網(wǎng)卡參數(shù):
// 查詢網(wǎng)口基本信息
[root@cnLinuxer ~]# ethtool ens33
// 查詢ens33對(duì)應(yīng)哪張網(wǎng)卡
[root@cnLinuxer ~]# ethtool -p ens33 10 【哪塊網(wǎng)卡的LED燈在閃,ens33就對(duì)應(yīng)哪塊物理網(wǎng)卡】
// 查詢網(wǎng)口的驅(qū)動(dòng)相關(guān)信息
[root@cnLinuxer ~]# ethtool -i ens33
driver: e1000
version: 7.3.21-k8-NAPI
// 查看網(wǎng)卡在接收/發(fā)送數(shù)據(jù)時(shí),有沒有出錯(cuò)
[root@cnLinuxer ~]# ethtool -S ens33
實(shí)例2
配置網(wǎng)卡參數(shù)
// 設(shè)置網(wǎng)卡工作模式
[root@cnLinuxer ~]# ethtool -s ens33 autoneg off speed 100 duplex full
// 將千兆網(wǎng)卡的速度降為百兆
[root@cnLinuxer ~]# ethtool -s ens33 speed 100
// 停止網(wǎng)卡的發(fā)送模塊TX
[root@cnLinuxer ~]# ethtool -A tx off ens33
// 查看網(wǎng)卡的tx模塊是否已被停止
[root@cnLinuxer ~]# ethtool -a ens33
// 關(guān)閉網(wǎng)卡對(duì)收到的數(shù)據(jù)包的校驗(yàn)功能
[root@cnLinuxer ~]# ethtool -K ens33 rx off
// 查看網(wǎng)卡對(duì)收到數(shù)據(jù)包的校驗(yàn)功能是否已被停止
[root@cnLinuxer ~]# ethtool -k ens33
有收獲,點(diǎn)個(gè)在看
評(píng)論
圖片
表情
