虚拟机添加了网卡但是无法启动解决方案

实际环境:

我安装了一个centos6.9系统,安装完之后我将原来的网卡移除,再重新添加了一个网卡

导致原来网卡的配置文件和现阶段的网卡mac地址不一样,无法正常启动网卡

问题:

显示
Bringing up interface eth0:  Device eth0 does not seem to be present,delaying initialization.

 

解决方法;

打开文件

[apps@anza tmp]$ vim /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:14:18:2c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:14:18:2e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

 

 修改为如下:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:14:18:2e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

注意查看address和eth*的不同

 

还要修改eth0配置文件

[root@nginxload ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 

DEVICE=eth0
HWADDR=00:0C:29:14:18:2e
TYPE=Ethernet
UUID=f8aa2b9a-ef40-4750-bcf1-c8f4d8c6cec3
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp

 

重启服务:

service network restart

或者重启服务器

reboot

posted @ 2020-02-04 19:59  linux——quan  阅读(1713)  评论(0编辑  收藏  举报