Solve the problem of modifying MAC address under Linux

Source: Internet
Author: User

in the Linux, modify MAC Address

# Ifdown Eth0

# ifconfig eth0 hw ether 12:34:56:78:90:12

(The modified MAC address differs from the original address)

# ifup Eth0 (modified successfully)

After, with # Ifconfig view, MAC address changed, but after entering #service network restart or ifdown eth0 command, the following error message will appear:

Device eth0 has MAC address 12:34:56:78:90:12, instead of configured address 00:0c:29:ca:b5:7d. Ignoring.

Therefore, it is not possible to modify the/etc/sysconfig/network-scripts/ifcfg-eth0 file to change the IP address and other related information, because the service network restart cannot make it effective, but with ifconfig Eth0 can temporarily change its IP address, reboot and then return to prototype.

Now solve

"Device eth0 has MAC address 12:34:56:78:90:12, instead of configured address 00:0c:29:ca:b5:7d. Ignoring. " The problem:

This problem occurs because of a configuration file: The macaddr=00:0c:29:ca:b5:7d address in/etc/sysconfig/network-scripts/ifcfg-eth0 is different from the 12:34:56:78:90:12, Macaddr=00:0c:29:ca:b5:7d can be modified to 12:34:56:78:90:12, the error is eliminated, you can use the #service network restart, but after the restart, the MAC address back to the prototype, the solution is:

Add these three sentences to the/etc/rc.d/rc.local.

Ifconfig eth0 Down

ifconfig eth0 hw ether 12:34:56:78:90:12

Ifconfig eth0 up

The macaddr=00:0c:29:ca:b5:7d address in/etc/sysconfig/network-scripts/ifcfg-eth0 will also be changed to 12:34:56:78:90:12

This re-reboot will not be afraid of Mac recovery, and #service network restart will not appear in the wrong language.

Reference URL:

Http://blog.chinaunix.net/u1/48373/showart_2072683.html

Http://bbs.chinaunix.net/viewthread.php?tid=1488738&extra=page%253D1&page=1

http://fangmenghu.blog.163.com/blog/static/1245820200910993138196/

Http://linux.chinaunix.net/techdoc/install/2008/06/05/1009396.shtml


Source: [email protected] /blog/static/21424296201021622239765/>

Solve the problem of modifying 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.