How to modify the NIC MAC address under Linux

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.