Linux 設置網卡半/全雙工


網卡的工作模式是半雙工,會導致服務器間通訊異常。

查看linux網卡工作狀態:

# ethtool ethX

修改linux網卡的工作模式:

ethtool –r ethX                          ## 重置ethX網口到自適應模式
ethtool –S ethX                          ## 查詢ethX網口收發包統計
ethtool –s ethX [speed 10|100|1000]        ## 設置網口速率10/100/1000M
[duplex half|full]                     ## 設置網口半/全雙工
[autoneg on|off]                      ## 設置網口是否自協商

# ethtool -s eth0 duplex full autoneg off speed 100

 

linux網卡工作模式開機就是全雙工的方法:

一:
在/etc/sysconfig/network-script/ifcfg-ethX加入下面這句:
ETHTOOL_OPTS="speed 100 duplex full autoneg off"
二:
將上面的命令寫入到/etc/rc.local里面。
ethtool -s eth0 duplex full autoneg off speed 100

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM