日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > linux >内容正文

linux

【Linux】一步一步学Linux——ethtool命令(155)

發(fā)布時(shí)間:2024/4/21 linux 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【Linux】一步一步学Linux——ethtool命令(155) 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

00. 目錄

文章目錄

    • 00. 目錄
    • 01. 命令概述
    • 02. 命令格式
    • 03. 常用選項(xiàng)
    • 04. 參考示例
    • 05. 總結(jié)
    • 06. 附錄

01. 命令概述

ethtool命令用于查詢ethX網(wǎng)口基本設(shè)置、及設(shè)置網(wǎng)卡的參數(shù)。

命令比較復(fù)雜,功能特別多。

02. 命令格式

ethtool [ -a | -c | -g | -i | -d | -k | -r | -S |] ethX ethtool [-A] ethX [autoneg on|off] [rx on|off] [tx on|off] ethtool [-C] ethX [adaptive-rx on|off] [adaptive-tx on|off] [rx-usecs N] [rx-frames N] [rx-usecs-irq N] [rx-frames-irq N] [tx-usecs N] [tx-frames N] [tx-usecs-irq N] [tx-frames-irq N] [stats-block-usecs N][pkt-rate-low N][rx-usecs-low N] [rx-frames-low N] [tx-usecs-low N] [tx-frames-lowN] [pkt-rate-high N] [rx-usecs-high N] [rx-frames-high N] [tx-usecs-high N] [tx-frames-high N] [sample-interval N] ethtool [-G] ethX [rx N] [rx-mini N] [rx-jumbo N] [tx N] ethtool [-e] ethX [raw on|off] [offset N] [length N] ethtool [-E] ethX [magic N] [offset N] [value N] ethtool [-K] ethX [rx on|off] [tx on|off] [sg on|off] [tso on|off] ethtool [-p] ethX [N] ethtool [-t] ethX [offline|online] ethtool [-s] ethX [speed 10|100|1000] [duplex half|full] [autoneg on|off] [port tp|aui|bnc|mii] [phyad N] [xcvr internal|external] [wol p|u|m|b|a|g|s|d...] [sopass xx:yy:zz:aa:bb:cc] [msglvl N]

03. 常用選項(xiàng)

-a 查看網(wǎng)卡中 接收模塊RX、發(fā)送模塊TX和Autonegotiate模塊的狀態(tài):啟動(dòng)on 或 停用off。 -A 修改網(wǎng)卡中 接收模塊RX、發(fā)送模塊TX和Autonegotiate模塊的狀態(tài):啟動(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)的名稱(chē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地址等。

04. 參考示例

4.1 查詢網(wǎng)卡基本設(shè)置

[deng@localhost ~]$ ethtool ens33 Settings for ens33:Supported ports: [ TP ]Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supported pause frame use: NoSupports auto-negotiation: YesSupported FEC modes: Not reportedAdvertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: NoAdvertised auto-negotiation: YesAdvertised FEC modes: Not reportedSpeed: 1000Mb/sDuplex: FullPort: Twisted PairPHYAD: 0Transceiver: internalAuto-negotiation: onMDI-X: off (auto) Cannot get wake-on-lan settings: Operation not permittedCurrent message level: 0x00000007 (7)drv probe linkLink detected: yes [deng@localhost ~]$

4.2 查詢網(wǎng)卡驅(qū)動(dòng)相關(guān)信息

[deng@localhost ~]$ ethtool -i ens33 driver: e1000 version: 7.3.21-k8-NAPI firmware-version: expansion-rom-version: bus-info: 0000:02:01.0 supports-statistics: yes supports-test: yes supports-eeprom-access: yes supports-register-dump: yes supports-priv-flags: no [deng@localhost ~]$

4.3 查詢網(wǎng)卡收發(fā)包統(tǒng)計(jì)

[deng@localhost ~]$ ethtool -S ens33 NIC statistics:rx_packets: 15796742tx_packets: 31586rx_bytes: 4802989050tx_bytes: 5649128

4.4 查詢網(wǎng)卡注冊(cè)信息

[root@localhost ~]# ethtool -d ens33 MAC Registers ------------- 0x00000: CTRL (Device control register) 0x00C00249Endian mode (buffers): littleLink reset: resetSet link up: 1Invert Loss-Of-Signal: no

4.5 設(shè)置網(wǎng)卡自適應(yīng)模式

[root@localhost ~]# ethtool -r ens33 [root@localhost ~]#

4.6 設(shè)置網(wǎng)卡速率等信息

[root@localhost ~]# ethtool -s ens33 autoneg off speed 100 duplex full

4.7 停止網(wǎng)卡的發(fā)送模塊TX

[root@localhost ~]# ethtool -A tx off ens33

4.8 設(shè)置網(wǎng)卡速率為100M

[root@localhost ~]# ethtool -s ens33 speed 100

4.9 使網(wǎng)卡燈閃爍10次

[root@localhost ~]# ethtool -p ens33 10 [root@localhost ~]#

操作完畢后,看哪塊網(wǎng)卡的led燈在閃,eth0就對(duì)應(yīng)著哪塊網(wǎng)卡。

4.10 顯示網(wǎng)卡Offload參數(shù)的狀態(tài)

[root@localhost ~]# ethtool -k ens33 Features for ens33: rx-checksumming: off tx-checksumming: ontx-checksum-ipv4: off [fixed]tx-checksum-ip-generic: ontx-checksum-ipv6: off [fixed]tx-checksum-fcoe-crc: off [fixed]tx-checksum-sctp: off [fixed]

4.11 關(guān)閉網(wǎng)卡對(duì)收到的數(shù)據(jù)包的校驗(yàn)功能

[root@localhost ~]# ethtool -K ens33 rx off

4.12 顯示EEPROM dump信息

[root@localhost ~]# ethtool -e ens33 Offset Values ------ ------ 0x0000: 00 50 56 26 d8 88 20 04 ff ff ff ff ff ff ff ff 0x0010: 00 00 00 00 0b 46 50 07 ad 15 0f 10 86 80 e8 01 0x0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 0x0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 0x0040: de df 61 78 0c 28 00 00 c8 00 ff ff ff ff ff ff 0x0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff 02 06 0x0060: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 0x0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 3a 0x0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 0x0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [root@localhost ~]#

05. 總結(jié)

06. 附錄

參考:【Linux】一步一步學(xué)Linux系列教程匯總

總結(jié)

以上是生活随笔為你收集整理的【Linux】一步一步学Linux——ethtool命令(155)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。