method one:
Select a default card when creating a virtual machine, you need to add a new card:
1. Right-virtual machine, edit the settings, select new equipment -> Network -> Add, select the card you want to add.
2, log in to the system, ifconfig command finding new card, and no new eth files in / etc / sysconfig / network-script / directory.
3, use ifconfig -a view, you can see the card added, cat /etc/udev/rules.d/70-persistent-net.rules can see the MAC address of the new network card.
4, cd / etc / sysconfig / network-scripts / directory copy of the original card to the new card configuration file name:
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1
5, i.e. modifying device card device name and profile HWADDR i.e. NIC MAC. At the same time add a new IP, reboot the network card (service network restart).
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1
Method Two:
Today, the landlord would like to configure a new network card under Linux eth0: 1, in time to restart the network card error: Bringing up interface eth1: Device eth1 does not seem to be present, delaying initialization [FAILED].:
On Baidu found a solution to the problem, and now for everyone to share
1、重启网卡提示Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization. [FAILED]:
2、这是因为克隆的机器没有正确的mac,UUID信息冲突导致的,首先将/etc/udev/rules.d/70-persistent-net.rules文件清空:
3、rm -f /etc/udev/rules.d/70-persistent-net.rules文件删除(或者重命名):cat /etc/udev/rules.d/70-persistent-net.rules
4、然后将网卡配置文件/etc/sysconfig/network-scripts/ifcfg-eth0的uuid和hwaddr这两行删除:
5、执行reboot命令,重启系统
6、这时重启网卡就能正常重启了:/etc/init.d/network restart
7、查看主机IP地址,正常获取:ip add
当楼主完成了上述操作的时候发现还是不行,于是就把网卡的名字从ifcfg-eth1(注:ifcfg-eth1是通过复制ifcfg-eth0得到的新的网卡 只需要修改其中的配置即可)改为了ifcfg-eth0:1 并且网卡里面的DEVICE的名字也要跟着改为ifcfg-eth0:1
然后/etc/init.d/network restart重启网络就成功了!
接着楼主又发现一个问题在重启网卡服务的时候出现了这样的警告:
Determining if ip address is already in use for device eth0
虽然不影响网卡的运行 可是也要解决这个问题 查阅了相关资料 终于得到了解决的办法:
解决办法:
vim /etc/sysconfig/network-scripts/ifcfg-eth0 (这里的网卡名称根据自己的网卡名称来写)
#增加一条
ARPCHECK=no
重启服务:service network restart
原文:https://blog.csdn.net/qq_32575047/article/details/78896534