acer 4560G在Ubuntu10.04系統下的有線網絡無法連接的問題
ubuntu10.04 用了很久了,一直有一個問題困擾著我,就是有線網絡連不上的問題,既然有線網絡連不上那就不用有線了,但是,沒有有線上網的電腦總是感覺電腦少了只胳膊似的,一直以來在找尋一個方法可以讓我的電腦連上有線網絡。
在網上找了很多方法,但是我的電腦的情況很少,執行ifconfig命令只有lo和wlan,沒有eth0,說明電腦有線網卡根本就沒有啟動,也就是有線網卡的驅動沒有安轉,下面詳細講講我的解決方法,
(1)、確認網卡驅動是否安裝
終端下輸入:
ifconfig
若 回環節口(lo),以太網卡(eth0),無線網卡(wlan0)的信息都有顯示,說明不是驅動的問題,您可以不要繼續看下去了。我的電腦就是沒有中點eth0的信息,說明我的有線網卡沒有驅動,接下來看第二步.
(2)、確認網卡型號
終端輸入:
lspci
輸出信息如下:
00:00.0 Host bridge: Advanced Micro Devices [AMD] Device 1705
00:01.0 VGA compatible controller: ATI Technologies Inc Device 9647
00:01.1 Audio device: ATI Technologies Inc Device 1714
00:03.0 PCI bridge: Advanced Micro Devices [AMD] Device 1708
00:04.0 PCI bridge: Advanced Micro Devices [AMD] Device 1709
00:06.0 PCI bridge: Advanced Micro Devices [AMD] Device 170b
00:11.0 SATA controller: Advanced Micro Devices [AMD] Device 7800 (rev 40)
00:12.0 USB Controller: Advanced Micro Devices [AMD] Device 7807 (rev 11)
00:12.2 USB Controller: Advanced Micro Devices [AMD] Device 7808 (rev 11)
00:13.0 USB Controller: Advanced Micro Devices [AMD] Device 7807 (rev 11)
00:13.2 USB Controller: Advanced Micro Devices [AMD] Device 7808 (rev 11)
00:14.0 SMBus: Advanced Micro Devices [AMD] Device 780b (rev 13)
00:14.2 Audio device: Advanced Micro Devices [AMD] Device 780d (rev 01)
00:14.3 ISA bridge: Advanced Micro Devices [AMD] Device 780e (rev 11)
00:14.4 PCI bridge: Advanced Micro Devices [AMD] Device 780f (rev 40)
00:16.0 USB Controller: Advanced Micro Devices [AMD] Device 7807 (rev 11)
00:16.2 USB Controller: Advanced Micro Devices [AMD] Device 7808 (rev 11)
00:18.0 Host bridge: Advanced Micro Devices [AMD] Device 1700 (rev 43)
00:18.1 Host bridge: Advanced Micro Devices [AMD] Device 1701
00:18.2 Host bridge: Advanced Micro Devices [AMD] Device 1702
00:18.3 Host bridge: Advanced Micro Devices [AMD] Device 1703
00:18.4 Host bridge: Advanced Micro Devices [AMD] Device 1704
00:18.5 Host bridge: Advanced Micro Devices [AMD] Device 1718
00:18.6 Host bridge: Advanced Micro Devices [AMD] Device 1716
00:18.7 Host bridge: Advanced Micro Devices [AMD] Device 1719
01:00.0 VGA compatible controller: ATI Technologies Inc Device 6760
02:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57785 Gigabit Ethernet PCIe (rev 10)
02:00.1 SD Host controller: Broadcom Corporation Device 16bc (rev 10)
02:00.2 System peripheral: Broadcom Corporation Device 16be (rev 10)
02:00.3 System peripheral: Broadcom Corporation Device 16bf (rev 10)
03:00.0 Network controller: Atheros Communications Inc. AR9287 Wireless Network Adapter (rev 01)
電腦硬件的不同,以上輸出有一定的出入,但是大體上是一樣的,
我們可以看到如下一行:
02:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57785 Gigabit Ethernet PCIe (rev 10)
這一行就是有線網卡的信息:我的網卡型號是Broadcom公司的BCM57785,
(3)下載相應的網卡驅動
從broadcom官網下載對應型號的網卡驅動:
http://zh-cn.broadcom.com/support/ethernet_nic/downloaddrivers.php
我下的安裝包為:linux-3.129d.zip
(4)安裝驅動
解壓安裝包,在Server/Linux/Driver目錄下有*.tar.gz格式和*.src.rpm格式的文件,README.TXT中有安裝過程,我選擇的是*.tar.gz格式的安裝包。
(1)解壓tar格式的安裝包
tar xvzf tg3-<version>.tar.gz
(2)編譯生成.o或.ko文件
cd tg3-<version>
make
生成的.o或.ko文件是與正在運行的內核想匹配的。
(3)測試並安裝驅動模塊
sudo insmod tg3.o
若在2.6.X內核下,則
sudo insmod tg3.ko (on 2.6.x kernels)
(4)測試
終端輸入:ifconfig
eth0的信息出來了。
接下來就是配置網絡,配置網絡有兩種方法:
(1)直接在圖形界面中配置
(2)修改 /etc/network/interfaces和/etc/resolv.conf,這個網上資料很多,在此轉載一具體方法如下:
a. 配置靜態ip地址
$sudo vim /etc/network/interfaces
原有內容只有如下兩行:
auto lo
iface lo inet loopback
向末尾追加以下內容:
auto eth0
iface eth0 inet static
address 192.168.0.33
gateway 192.168.0.1
netmask 255.255.255.0
然後保存退出;
b. 手動配置 dns
$sudo vi /etc/resolv.conf
想末尾追加如下內容:
nameserver 192.168.0.10
然後保存退出。
c. 重啟 network 使修改生效
$sudo /etc/init.d/networking restart
這裡有點有問題,就是重啟ubuntu後,發現又不能上網了,問題出在 /etc/resolv.conf,重啟後,此文件配置的dns又被自動修改為默認值。所以需要永久性修改DNS。方法如下:
cd /etc/resolvconf/resolv.conf.d/
# cat base
nameserver 8.8.8.8