您的位置:首页 > 理论基础 > 计算机网络

Ubuntu主机更换主板后,主板集成网口无法上网。

2012-11-16 10:28 246 查看
Ubuntu主机更换主板后,主板集成网口无法上网。

查询网络信息报错:

ifconfig eth0

eth0: 获取接口信息时发生错误: Device not found

ifconfig eth1

eth1: 获取接口信息时发生错误: Device not found

打开/etc/udev/rules.d/70-persistent-net.rules

可以发现有新的网卡配置项,例如eth2、eth3(根据原最大eth号递增)。

双网口时,也有可能同是两个eth2,但MAC不同。

解决方法:

sudo nano /etc/udev/rules.d/70-persistent-net.rules

注释或删除原来的eth0和eth1的配置行,将新网卡配置项eth2、eth3或者双eth2分别改成eth0、eth1。

重启主机即可。

或者:

sudo /etc/init.d/networking restart

修改interfaces配置bonding后,以上重启语句从未成功。

又或者试试?:

sudo /etc/init.d/network-interface restart

sudo /etc/init.d/network-interface-security restart

sudo /etc/init.d/network-manager restart

注意:
本文场景是更换主板后,不重装Ubuntu系统。

通常MAC地址较小的,eth号也较小。编辑70-persistent-net.rules时需要注意。

以上为双网口主板,单网口主板只需注释或删除eth0后,将eth1改成eth0即可。

更换独立网卡时,应该同理。

参考网址
http://os.chinaunix.net/a2009/0318/992/000000992580.shtml
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Ubuntu 主板 网口 网络