虛擬機添加了網卡但是無法啟動解決方案


實際環境:

我安裝了一個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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM