VirtualBox-复制虚拟机-重置网卡

2022-04-13 15:39:39 浏览数 (1)

情况说明

改网卡名

改拥有新虚拟机MAC地址的网卡名称为eth0; 注释掉原eth0;

代码语言:javascript复制
[root@lebron ~]# vim /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:0x100e (e1000)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:1c:68:04", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:ee:4b:73", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:6c:8b:62", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

改eth0的MAC地址

代码语言:javascript复制
[root@lebron ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:6C:8b:62
TYPE=Ethernet
UUID=1e3c54ec-0df1-42f7-a577-6a18be5a839e
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp

0 人点赞