怎么在CentOS中使用ethtool命令-創(chuàng)新互聯(lián)

今天就跟大家聊聊有關(guān)怎么在CentOS中使用ethtool命令,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比天山網(wǎng)站開(kāi)發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式天山網(wǎng)站制作公司更省心,省錢(qián),快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋天山地區(qū)。費(fèi)用合理售后完善,10多年實(shí)體公司更值得信賴。

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

使用概要:

ethtool ethx       //查詢ethx網(wǎng)口基本設(shè)置,其中 x 是對(duì)應(yīng)網(wǎng)卡的編號(hào),如eth0、eth2等等

ethtool –h        //顯示ethtool的命令幫助(help)

ethtool –i ethX    //查詢ethX網(wǎng)口的相關(guān)信息

ethtool –d ethX    //查詢ethX網(wǎng)口注冊(cè)性信息

ethtool –r ethX    //重置ethX網(wǎng)口到自適應(yīng)模式

ethtool –S ethX    //查詢ethX網(wǎng)口收發(fā)包統(tǒng)計(jì)

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)[root@linux /]# ethtool eth2

Settings for eth2:

Supported ports: [ TP ]

Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Full

Supports auto-negotiation: Yes

Advertised link modes: 10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Full

Advertised auto-negotiation: Yes

Speed: 1000Mb/s

Duplex: Full

Port: Twisted Pair

PHYAD: 0

Transceiver: internal

Auto-negotiation: on

Supports Wake-on: umbg

Wake-on: d

Link detected: yes

2)[root@linux /]# ethtool -i eth2

driver: e1000

version: 5.0.43-k1

firmware-version: N/A

bus-info: 06:08.1

3)[root@linux /]# ethtool -S eth2

NIC statistics:

rx_packets: 58068300

tx_packets: 87124083

rx_bytes: 1589713008

tx_bytes: 2165825901

rx_errors: 0

tx_errors: 0

rx_dropped: 0

tx_dropped: 0

multicast: 0

collisions: 0

rx_length_errors: 0

rx_over_errors: 0

rx_crc_errors: 0

rx_frame_errors: 0

rx_fifo_errors: 0

rx_missed_errors: 0

tx_aborted_errors: 0

tx_carrier_errors: 0

tx_fifo_errors: 0

tx_heartbeat_errors: 0

tx_window_errors: 0

4)[root@linux /]# ethtool -s eth2 autoneg off speed 100 duplex full

相關(guān)參考:

1)[root@linux /]# which ethtool        //查詢 ethtool 存放的路徑

    /sbin/ethtool

2)[root@linux /]# rpm -qf /sbin/ethtool        //查詢 ethtool 的版本信息

   ethtool-1.6-5

3)將 ethtool 設(shè)置永久保存在網(wǎng)絡(luò)設(shè)備的方法

解決方法一:

ethtool 設(shè)置可通過(guò) /etc/sysconfig/network-scripts/ifcfg-ethX 文件保存,從而在設(shè)備下次啟動(dòng)時(shí)激活選項(xiàng)。

例如:ethtool -s eth0 speed 100 duplex full autoneg off

此指令將eth0設(shè)備設(shè)置為全雙工自適應(yīng),速度為100Mbs。若要eth0啟動(dòng)時(shí)設(shè)置這些參數(shù), 修改文件/etc/sysconfig/network-scripts/ifcfg-eth0 ,添加如下一行:

ETHTOOL_OPTS="speed 100 duplex full autoneg off"

解決方法二:

將ethtool設(shè)置寫(xiě)入/etc/rc.d/rc.local之中。

看完上述內(nèi)容,你們對(duì)怎么在CentOS中使用ethtool命令有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。

當(dāng)前名稱:怎么在CentOS中使用ethtool命令-創(chuàng)新互聯(lián)
當(dāng)前URL:http://www.muchs.cn/article26/pcejg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供建站公司、網(wǎng)站設(shè)計(jì)公司網(wǎng)站內(nèi)鏈、企業(yè)網(wǎng)站制作、網(wǎng)站改版、ChatGPT

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設(shè)