克隆虚拟机后发现网卡名称与配置对不上,原网卡名eth0,ip:192.168.1.122,克隆后网卡名eth1,ip:192.168.1.127
解决如下,
[[email protected] ~]#sed -i ‘/eth0/d‘ /etc/udev/rules.d/70-persistent-net.rules [[email protected] ~]#sed -i ‘s/eth1/eth0/‘ /etc/udev/rules.d/70-persistent-net.rules [[email protected] ~]#sed -i ‘/^HWADDR/d‘ /etc/sysconfig/network-scripts/ifcfg-eth0 [[email protected] ~]#sed -i ‘/^UUID/d‘ /etc/sysconfig/network-scripts/ifcfg-eth0 [[email protected] ~]#sed -i ‘s/192.168.1.122/192.168.1.127/‘ /etc/sysconfig/network-scripts/ifcfg-eth0 [[email protected] ~]#service network restart [[email protected] ~]#rebbot
时间: 2024-10-11 21:56:34