?eth0变成eth1的后果?
♪ The consequences of becoming eth1 ♪ ♪ strong eth0 ♪ ♪ xff1f;
?无法重启网络服务,即不能联网
? Unable to restart network service & #xff0c; i.e. unconnected
eth0变成eth1的原因?
eth0 became eth1?
很多Linux distribution使用udev动态管理设备文件,并根据设备的信息对其进行持久化命名。udev会在系统引导的过程中识别网卡,将mac地址和网卡名称对应起来记录在udev的规则脚本中。而对于新的虚拟机,VMware会自动为虚拟机的网卡生成MAC地址,当你克隆或者重装虚拟机软件时,由于你使用的是以前系统虚拟硬盘的信息,而该系统中已经有eth0的信息,对于这个新的网卡,udev会自动将其命名为eth(1~*)[累加的原则],所以在你的系统启动后,你使用ifconfig看到的网卡名为eth*。
Many Linux database uses the udev dynamic management device file & #xff0c; renaming it on the basis of information on the device. The udev will identify the web card & #xff0c during the system-guiding process; the name of the Mac address and the web card will be recorded in the rules script of the udev. For the new virtual machine & #xff0c; for VMware will automatically generate the MAC address & #xff0c for the virtual machine web card; for you clone or reassemble the virtual machine software xff0c; for the information you used on the virtual hard disk of the previous system xff0c; for the system there is already Eth0 information #xff0c; for the new web card #xff0c; for the new web card #udev will automatically be named Eth (1~) xff0c; so after your system has been activated xff0c; for the web card you have used ifconfig it is named Eth*.
如何恢复到eth0?
How to get back to eth0?
1.在centos中,udev记录网络规则的脚本为:/etc/udev/rules.d/70-persistent-net.rules
打开该文件,这时你会发现,里面有eth0,eth1两个网卡的信息,但实际上你ifconfig时只能发现eth1一个网卡的信息,这时因为eth0根本就不存在。
将其中eth0的信息删掉,并将eth1信息中的设备名改为eth0,你看到的网卡就是eth0了,或者删掉其中所有的信息重启系统udev会帮你发现新的设备的。
In & #xff0c; in centos, the script for recording network rules in : /etc/dev/rules.d/70-persistent-net.rules
opens this file & #xff0c; , eth0xff0c; eth1 card & xff0c; but in fact you can only find information about xff0c; this is because eth0 does not exist.
deletes the eth0 information from xff0c; and change the name of equipment in eth1 to eth0xff0c; you see the eth0 ff0c; or delete all the information reboot system udev.
2.另外还有一个启动脚本文件/etc/sysconfig/network-scripts/ifcfg-eth0,该文件中的mac地址为原来eth0网卡的物理地址,而虚拟机为eth1分配新的物理地址,故启动脚本中的信息与实际信息时不匹配的,将MAC的地址信息修改为70-persistent-net.rules中的eth1的MAC地址,重启系统,就完全恢复到以前eth0网卡的状态了。
2.
?
转载原文:https://blog.csdn.net/xwm1999/article/details/53070824
xff1a; https://blog.csdn.net/xwm1999/article/details/53070824
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论