Online there are many ways to modify the MAC address under Linux, most of the gourd painting gourd, seems to have not been verified, not to modify the purpose.
After my detailed test, the problem was finally solved successfully.
Myth One:
#ifconfig eth0 Down
#ifconfig eth0 hw ether 00:aa:bb:cc:dd:ee
#ifconfig eth0 up
Then restart the host.
Conclusion: After modifying the MAC address in this way, the MAC address will be restored automatically after restarting the host system.
Myth Two:
#ifconfig eth0 Down
#cd/etc/sysconfig/network-scripts
#vi Ifcfg-eth0
Modify the "hwaddr=xx:xx:xx:xx:xx:xx" in them
#ifconfig eth0 up
#service Network Start
Conclusion: After modifying the MAC address in this way, you will not be able to enable the network, the following prompt appears: "Bringing up interface Eth0:device eth0 have different MAC addresses than Expected,ignorin G. "
So how do you ensure that the modified MAC address is permanently saved in a Linux environment? The correct steps are as follows:
#ifconfig eth0 Down
#cd/etc/sysconfig/network-scripts
#vi Ifcfg-eth0
Modify the "hwaddr=xx:xx:xx:xx:xx:xx" to "macaddr=xx:xx:xx:xx:xx:xx"
#ifconfig eth0 up
#service Network Start
Keywords: hwaddr and macaddr are different.
How to modify the NIC MAC address under Linux