• 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也能适应大多是情况了,先暂且如此。

  • 相关阅读:
    mybatis-plus物理分页插件使用
    mybatis-plus提供支持ActiveRecord模式
    mybatis-plus通用Service
    mybatis-plus返回查询总记录数
    Mybatis-Plus查询返回Map类型数据
    Mybatis-Plus条件构造器condition动态判断条件
    Mybatis-Plus条件构造器select方法返回指定字段
    mybatis-plus条件构造器UpdateWrapper实例
    mybatis-plus条件构造器QueryWrapper实例
    这玩意比ThreadLocal叼多了,吓得why哥赶紧分享出来。
  • 原文地址:https://www.cnblogs.com/pied/p/4228383.html
Copyright © 2020-2023  润新知