The solution to modify MAC address problem under Linux _linux
Source: Internet
Author: User
In Linux, modify the MAC address
# Ifdown Eth0
# ifconfig eth0 hw ether 12:34:56:78:90:12
(The modified MAC address is different from the original address)
# ifup Eth0 (modified successfully)
After, with the # Ifconfig view, MAC address changed, but then enter #service network restart or Ifdowneth0 command, the following error message appears:
Device eth0 has MAC address 12:34:56:78:90:12, instead ofconfigured address 00:0c:29:ca:b5:7d. Ignoring.
So at this time can not modify the/etc/sysconfig/network-scripts/ifcfg-eth0 file to change the IP address and other related information, because servicenetwork restart cannot make it effective, but with ifconfig Eth0 can temporarily change its IP address, reboot and return to the prototype.
Now solve
"Device eth0 has MAC address 12:34:56:78:90:12, instead ofconfigured address 00:0c:29:ca:b5:7d. Ignoring. " The problem:
This problem occurs because of the 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. You can modify the macaddr=00:0c:29:ca:b5:7d to 12:34:56:78:90:12, then the error is eliminated, you can use #servicenetwork 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 Hwether 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 reboot after the Mac is not afraid of recovery, and #service Networkrestart also will not appear wrong language.
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