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