CentOS:Device eth0 does not seem to be present 问题解决方法

简介:

使用Vmware克隆linux虚拟机后,常常是网络连接不上,表现为ifconfig无法看到网卡,即使改了/etc/sysconfig/network-scripts/下的相应网卡文件onboot=yes也不行,重启网络时(/etc/init.d/network restart)会出现以下错误提示:

    "Device eth0 does not seem to be present, delaying initialization."


这是由于克隆机的网卡配置文件错误导致的,解决方法:


1.打开/etc/udev/rules.d/70-persistent-net.rules 文件。

2.查找到匹配你机器MAC地址的行,将其“NAME”字段改为你现在下在使用的网卡设备名(eth0,eth1,eth2等),再将其他MAC不匹配的行删除或注释掉。如:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:04:19:2D:3F:52", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x1022:0x2000 (pcnet32)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:04:19:2D:3F:53", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

3.请将/etc/sysconfig/network-scripts/ifcfg-ethX(要改的网卡名)文件中的MAC地址和网卡名也作相应更改,并将onboot改为yes.

4.重启虚拟机,这是必须的。


注:在第二步里正确的mac地址要到Vsphere client 的管理界面Edit setting去查看,而不是在系统中/etc/sysconfig/network-scripts/中那个。


本文转自 拾瓦兴阁 51CTO博客,原文链接:http://blog.51cto.com/ponyjia/1618603

相关文章
|
Shell Linux
Centos7:“Entering emergency mode. Exit the shell to continue”错误解决方法
想过很多朋友有遇到这种情况,就是正在远程使用centos7系统时,一旦让远程虚拟机或服务器断电或强制关机,那么再次重启时就会出现“Entering emergency mode. Exit the shell to continue.”的错误。
14054 1
Centos7:“Entering emergency mode. Exit the shell to continue”错误解决方法
关于 CentOS8出现“Error: Failed to download metadata for repo ‘AppStream‘: xxxx” 的解决方法
关于 CentOS8出现“Error: Failed to download metadata for repo ‘AppStream‘: xxxx” 的解决方法
11358 0
关于 CentOS8出现“Error: Failed to download metadata for repo ‘AppStream‘: xxxx” 的解决方法
|
Linux 开发工具
centos7 中文乱码解决方法
centos7 中文乱码解决方法
1065 1
|
Linux 开发工具 数据安全/隐私保护
CentOS7报错:“xxx is not in the sudoers file. This incident will be reported“解决方法
CentOS7报错:“xxx is not in the sudoers file. This incident will be reported“解决方法
2625 1
|
缓存 Linux 开发工具
CentOS7 安装KDE报错的解决方法:Loaded plugins:fastestmirror,langpacks There is no installed group.
CentOS7 安装KDE报错的解决方法:Loaded plugins:fastestmirror,langpacks There is no installed group.
1243 0
|
Linux 测试技术 Shell
Centos7下安装Dogtail GUI自动化测试工具并打开sniff工具过程中遇到的问题解决方法
Centos7下安装Dogtail GUI自动化测试工具并打开sniff工具过程中遇到的问题解决方法
1082 0
Centos7下安装Dogtail GUI自动化测试工具并打开sniff工具过程中遇到的问题解决方法
|
缓存 Linux 开发工具
centos 7 yum安装失败(HTTP Error 404 - Not Found)的解决方法
centos 7 yum安装失败(HTTP Error 404 - Not Found)的解决方法
5763 0
|
Java Linux Shell
66Linux - centos安装jdk时出现没有/lib/ld-linux.so.2解决方法
66Linux - centos安装jdk时出现没有/lib/ld-linux.so.2解决方法
1027 0
|
关系型数据库 MySQL Java
Centos7安装jdk8以及mysql5.7以及Navicat连接虚拟机mysql的出错以及解决方法(附mysql下载出错解决办法)
Centos7安装jdk8以及mysql5.7以及Navicat连接虚拟机mysql的出错以及解决方法(附mysql下载出错解决办法)
568 0