linux基础学习――克隆备份后网卡不能启动

时间:2022-04-19 08:10:22

今天在练习的时候突然想到如果当前使用的虚拟机中的系统坏掉或者出现未知的故障而影响学习进度怎么办,毕竟重装一次系统要耽误不少时间,于是想把当前使用正常的系统COPY一个备份

    

     COPY完之后用VMware打开并更改名字,开机OK,登录OK,测试网络faile……重启网卡

     提示“Device eth0 does not seem to be present,delaying initialization”

     仔细想想,克隆备份……哦,网卡设置肯定不对,可当前这台虚拟机的网卡相关信息去哪儿找呢

     

百度一下找到下面这个文件

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

     打开

# This file was automatically generated by the /lib/udev/write_net_rules

# program, run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single

# line, and change only the value of the NAME= key.


# PCI device 0x8086:0x100f (e1000)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:27:aa:db", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


# PCI device 0x8086:0x100f (e1000)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:0e:59:33", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"



      记录下eth1的MAC

     

     去/etc/sysconfig/network-scripts/ifcfg-eth0中更改MAC, DEVICE和static的IP地址保存后重启网卡……OK