ifconfig没有eth0解决办法

一、如果输入ifconfig,没有eth0:,那你需要安装网卡驱动,如下:

ubuntu中查看网卡类型及是否安装网卡驱动程序   

1输入: lspci 或者 lspci –v 或lspci–vv

会显示所有的硬件信息和版本,然后在网上搜索linux下的驱动程序
03:00.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02) 
03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05) 
03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22) 
03:01.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12) 
03:01.3 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 12) 
0c:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02) 

其中: Ethernet controller: 是网卡型号

我的网卡型号:Ethernet controller: Intel Corporation Device 1502 (rev 04)

 

网驱动为:e1000e-1.6.2.tar.gz, 高版本可兼容低版本

下载地址:

http://tenet.dl.sourceforge.net/project/e1000/e1000e stable/1.6.2/e1000e-1.6.2.tar.gz

 

安装步骤:

his worked so easily for me. I went to sourceforge and downloaded the latest stable version, then followed the instruction in the README after I unzipped the archive. Literally all I had to do was:

tar -xvf e1000e-1.6.2.tar.gz  // 解压
cd e1000e-1.6.2/src/          // 找到程序所在目录
sudo make install             // 安装
sudo modprobe e1000e          // 载入
sudo dhclient eth0            //
dhclient 是直接控制eth 来进行网络操作自动获取IP

Done. Thanks for the help.


2 查看是否有网卡驱动

在终端输入 ifconfig –a

如果只出现    lo         Link encap:本地环回   
                           inet 地址:127.0.0.1  掩码:255.0.0.0 
                           inet6 地址: ::1/128 Scope:Host 
                           UP LOOPBACK RUNNING  MTU:16436  跃点数:1 
                           接收数据包:1650 错误:0 丢弃:0 过载:0 帧数:0 
                           发送数据包:1650 错误:0 丢弃:0 过载:0 载波:0 
                           碰撞:0 发送队列长度:0  

说明没有网卡驱动。

 

如果还       eth0        Link encap:以太网 硬件地址 00:1c:bf:ca:14:d7   
             inet 地址:192.168.0.104  广播:192.168.0.255  掩码:255.255.255.0 
             inet6 地址: fe80::21c:bfff:feca:14d7/64 Scope:Link 
             UP BROADCAST RUNNING MULTICAST  MTU:1500  跃点数:1 
             接收数据包:1242 错误:0 丢弃:0 过载:0 帧数:0 
             发送数据包:986 错误:0 丢弃:0 过载:0 载波:0 
             碰撞:0 发送队列长度:1000  
             接收字节:415788 (406.0 KB)  发送字节:185256 (180.9 KB) 

说明网卡驱动安装没有问题

转自:http://blog.sina.com.cn/s/blog_c0468c8f0101ld2x.html

二、如过输入ifconfig出现:

eth0:avahi Link encap:以太网 硬件地址 00:1d:72:56:28:9a
inet 地址:169.254.5.166 广播:169.254.255.255 掩码:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
中断:17

你需要设置一个静态ip,如下

打开终端,启动文本编辑器来编辑Linux网络配置文件,命令如下:
sudo gedit /etc/network/interfaces 

在这里你应该会看到如下内容: 
    auto lo 
    iface lo inet loopback 

这个正是lo回环,我需要让这台运行Ubuntu Server的机子通过DHCP获得IP来加入网络,那么我只需要在上面的lo回环的配置内容下面加入:  

    auto eth0 
    iface eth0 inet static 
    address 192.168.1.5 
    netmask 255.255.255.0 
    gateway 192.168.1.1 

如果是手动指定IP并且还需要访问互联网,那么还需要设置DNS: 
$sudo gedit /etc/resolv.conf 

假如dns地址为61.177.7.1,则向这里添加如下配置内容: 
nameserver 61.177.7.1 
保存即可。

重启网络组件让网络配置文件生效:  
$sudo /etc/init.d/networking restart 
只要显示Reconfiguring network interfaces... [OK] 
即成功重启网络组件。

转自:http://zhidao.baidu.com/question/140973627.html

参考:http://forum.ubuntu.org.cn/viewtopic.php?f=116&t=147105

设置DNS,我查的是另一个电脑里的DNS

查看DNS

转自:http://jingyan.baidu.com/article/a3a3f81194f5708da2eb8a19.html

  • 0
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值