網卡出現很詭異的問題,把電腦連到一些交換機上是工作的,連到另外一些就不行。。。交換機上的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也能適應大多是情況了,先暫且如此。