歡迎您光臨本站 註冊首頁

Ubuntu有線網路已斷開的另一種解決方法

←手機掃碼閱讀     火星人 @ 2014-03-12 , reply:0
  

前些天安裝了Elementary OS 本以為有線網路已斷開的問題會解決,但是安裝好后問題依然存在。本人先前安裝的是Ubuntu 12.04 後來升級到了13.04,在宿舍中上網插上網線一切正常,但是在教室中卻不行,一直提示有線網路已斷開,google了一下 修改ip 修改/etc/network/interfaces的方法都試過了還是不能解決,

後來想了想,宿舍可以,但是教室u而不可以,肯定不是網卡驅動的事情,而且網上有人說過網卡與交換機的不兼容性問題,於是百度了一下,果然有類似的問題。電腦網卡的工作模式設置不正確有可能導致與交換機不能通訊。

於是乎問題解決了

解決過程如下

1.安裝ethtool軟體設置網卡的工作模式

  1. sudo apt-get install ethtool

2. ethtool的命令

概要:

ethtool ethX //查詢ethX網口基本設置

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

ethtool ?i ethX//查詢ethX網口的相關信息

ethtool ?d ethX//查詢ethX網口註冊性信息

ethtool ?r ethX//重置ethX網口到自適應模式

ethtool ?S ethX//查詢ethX網口收發包統計

ethX 是網卡的代表,具體可以用ifconfig命令查看 第一塊有線網卡是eth0

這是我電腦設置過的網卡信息

  1. Settings for eth0:

  2.  Supported ports: [ TP MII ]

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

  4.  100baseT/Half 100baseT/Full

  5.  1000baseT/Half 1000baseT/Full

  6.  Supported pause frame use: No

  7.  Supports auto-negotiation: Yes

  8.  Advertised link modes:Not reported

  9.  Advertised pause frame use: No

  10.  Advertised auto-negotiation: No

  11.  Speed: 100Mb/s

  12.  Duplex: Full

  13.  Port: MII

  14.  PHYAD: 1

  15.  Transceiver: internal

  16.  Auto-negotiation: off

  17. Cannot get wake-on-lan settings: Operation not permitted

  18.  Current message level: 0x000020c6 (8390)

  19. probe link rx_err tx_err hw

  20. Cannot get link status: Operation not permitted

關閉了網卡的自動協商功能,設置網卡在100M下工作,設置全雙工的工作模式

命令如下

  1. sudo ethtool -s eth0 autoneg off speed 100 duplex full

設置以後 電腦奇迹般的能連上有線網路了

3.設置 開機自啟動

打開/etc/init.d/rc.local

  1. sudo vim /etc/init.c/rc.local

在文件的最後添加

  1. /sbin/ethtool -s eth0 autoneg off speed 100 duplex full

到此結束,希望能解決你的問題



[火星人 ] Ubuntu有線網路已斷開的另一種解決方法已經有1027次圍觀

http://coctec.com/docs/net/show-post-68151.html