虚拟机添加网卡

点击设置,

ip addr

cd /etc/sysconfig/network-scripts/

cp ifcfg-eth0 ifcfg-eth1

vi ifcfg-eth1

IPADDR=192.168.135.2
NETMASK=255.255.255.0

把UUID和HWADD这两行干掉

>/etc/udev/rules.d/70-persistent-net.rules

[root@Aaron network-scripts]# /etc/init.d/network restart
正在关闭接口 eth0: [确定]
正在关闭接口 eth1: [确定]
DEVICE=eth0
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 eth0: Determining if ip address 192.168.135.22 is already in use for device eth0...
[确定]
弹出界面 eth1:
正在决定 eth1 的 IP 信息...完成。
[确定]

解决方法:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

ARPCHECK=no(这里)
GATEWAY=192.168.135.254

原文地址:https://www.cnblogs.com/liangweixiong/p/7910202.html