zoukankan      html  css  js  c++  java
  • ethtool使用记录

    网卡出现很诡异的问题,把电脑连到一些交换机上是工作的,连到另外一些就不行。。。交换机上的link灯还时不时的闪一下,看起来像是在尝试连接。

    用dmesg查看,看到下面的信息:

    [ 1112.922110] jme 0000:05:00.5: irq 46 for MSI/MSI-X
    [ 1112.944596] jme 0000:05:00.5: eth0: Link is down
    [ 1112.945228] ADDRCONF(NETDEV_UP): eth0: link is not ready

    查了半天,也没弄明白是怎么回事,有人说是驱动问题。另外看到有人推荐用ethtool来强制定义为100M以太网。方法如下

    sudo ethtool -s eth0 speed 100 duplex full autoneg off

    设置后的效果,可以使用sudo ethtool eth0来查看。比如,我设置之前是

    Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: pg
        Wake-on: d
        Current message level: 0x000020c6 (8390)
                       probe link rx_err tx_err hw
        Link detected: no

    设置之后是:

    Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: pg
        Wake-on: d
        Current message level: 0x000020c6 (8390)
                       probe link rx_err tx_err hw
        Link detected: yes

    其中,最后Link detected是表示是否已检测到有以太网连接的。。。说明强制100M之后,就连上了。。。

    不知道这是为什么,反正100M也能适应大多是情况了,先暂且如此。

  • 相关阅读:
    前端开发在手机UC浏览器上遇到的坑
    前端开发在uc浏览器上遇到的坑
    object-fit 解决图片指定大小被压缩问题
    前端新手需要注意的几个问题
    利用apache搭建本地环境
    有简历,为何还要自我介绍?
    移动端项目总结
    JavaScript MVC框架PK:Angular、Backbone、CanJS与Ember(转载)
    Net Core 控制台程序使用Nlog 输出到log文件
    net core服务器缺包,如何在线安装?
  • 原文地址:https://www.cnblogs.com/pied/p/4228383.html
Copyright © 2011-2022 走看看