Linux的虚拟机拷贝到另外的操作系统时,NAT方式的(2)

1、首先执行ifconfig查看新的MAC地址:
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.130.109 netmask 255.255.255.0 broadcast 192.168.130.255
inet6 fe80::20c:29ff:fe94:8ea2 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:94:8e:a2 txqueuelen 1000(Ethernet)
RX packets 550 bytes 48524(47.3KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 604 bytes 94343(92.1KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0(LocalLoopback)
RX packets 8 bytes 800(800.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 800(800.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
可以看出ens33网卡对应的MAC地址为:00:0c:29:94:8e:a2,即ether对应的地址。

2、修改ens33网卡对应的MAC地址
vi /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE="Ethernet"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
NAME="ens33"
UUID="707084bc-d3aa-483f-878b-c93e6abf4a07"
ONBOOT="yes"
HWADDR="00:0C:29:8B:9A:F2"
BOOTPROTO="static"
NM_CONTROLLED="yes"
IPADDR="192.168.130.101"
NETMASK="255.255.255.0"
GATEWAY="192.168.130.2"

将HWADDR改为00:0c:29:94:8e:a2即可。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/16288.html