Ubuntu 12.04LTS 找不到eth0网卡

我的机器是DELL 14R INSPRION 7420 笔记本。试了好多方法都不行,比如这个教程:

1. sudo ifconfig -a //查看所有网卡现状,看eth0是否存在,在结果列表应该找不到eth0网卡的,除了lo之外,正常应该还有一个ethX
 
2. vim /etc/network/interfaces //修改内容如下
 
auto ethX
 
iface ethX inet dhcp
 
//或  www.2cto.com  
 
auto ethX
 
iface ethX inet static
 
address 192.168.0.101
 
netmask 255.255.255.0
 
gateway 192.168.0.1
 
3. sudo /etc/init.d/networking restart  //重新启动网卡,问题可解决。

 

因为我的网卡根本没有驱动进来,所以这些都是胡闹。

 

正确做法:

先查看一下网卡信息:

wy@wy-Inspiron-7420:~$ lspci -k|grep -i -A2 net
02:00.0 Network controller: Intel Corporation Centrino Wireless-N 2230 (rev c4)
    Subsystem: Intel Corporation Centrino Wireless-N 2230 BGN
    Kernel driver in use: iwlwifi
--
03:00.0 Ethernet controller: Atheros Communications Inc. AR8161 Gigabit Ethernet (rev 10)
    Subsystem: Dell Device 055f
    Kernel driver in use: alx

从上可见我的有线网卡是AR8161 Gigabit Ethernet。然后去找这个型号的网卡驱动并安装(如果是其它网卡的,在百度谷歌里去搜它的驱动)。

sudo -i    #进root权限

wget http://linuxwireless.org/download/compat-wireless-2.6/compat-wireless-2012-03-12-p.tar.bz2
tar xvf compat-wireless-2012-03-12-p.tar.bz2
cd compat-wireless-2012-03-12-p
./scripts/driver-select alx
make
make install
./scripts/alx-enable atl1c
./scripts/alx-enable alx
modprobe alx

ok,eth0出来啦。

 

 

posted @ 2014-04-18 14:57  duanguyuan  阅读(8087)  评论(0编辑  收藏  举报