虚拟化中,从模板克隆出来的虚拟机网卡都会被命名为eth1,而有些程序或者脚本,涉及到网卡的,默认写的是eth0,这时就存在要将eth1改为eth0的问题,方法如下:
In virtualization of
#vi /etc/udev/rules.d/70-persistent-net.rules
70-persistent-net.rules中仍然保留了老网卡的内容,新网卡则被识别为eth1。
The 70-persistent-net.rules still maintain the content of the old web card, while the new web card is identified as eth1.
将表示老网卡的行注释掉,然后将表示新网卡的行中eth1改成eth0
will indicate the line of the old card and then change the line of the new card to eth0
#mv /etc/sysconfig/network-scripts/ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-eth0
然后编辑/etc/sysconfig/network-scripts/ifcfg-eth0文件,将其中的eth1改为eth0即可:
Then edit/etc/sysconfig/network-scripts/ifcfg-eth0, and change the eth1 from eth0 to eth0 as follows:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
重启。
Reboot.
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论