Centos Mac Modification

Source: Internet
Author: User

Centos Mac Modification

Add a line in the file/etc/sysconfig/network-scripts/ifcfg-eth0 similar to the following

MACADDR = 00: 04: AC: 33: 1C: 3B

A: The MAC address is the physical address of the NIC. You can change the MAC address in Linux:
1) Close the NIC Device
/Sbin/ifconfig eth0 down
2) modify the MAC address
/Sbin/ifconfig eth0 hw ether MAC address
3) restart the NIC
/Sbin/ifconfig eth0 up
How to modify the nic mac address in Red Hat Linux
OS Version: Red Hat Enterprise Linux AS4
Core: Kernel 2.6.9-42

There are many ways to modify the MAC address in linux on the Internet, most of which are based on Huludao. They do not seem to have been verified and cannot be modified.
After my detailed tests, the problem was finally solved successfully.

Misunderstanding 1:
# Ifconfig eth0 down/* disable eth0 Nic. Here, the eth0 Nic is used as an example */
# Ifconfig eth0 hw ether 00: AA: BB: CC: DD: EE/* modify the MAC address of the eth0 Nic */
# Ifconfig eth0 up/* restart eth0 Nic */
Then restart the host.
Conclusion: According to this method, the MAC address is automatically restored after the host system is restarted.

Misunderstanding 2:
# Ifconfig eth0 down
# Cd/etc/sysconfig/network-scripts
# Vi ifcfg-eth0
Modify "HWADDR = xx: xx"
# Ifconfig eth0 up
# Service network start
Conclusion: The network cannot be enabled after the MAC address is modified according to this method, and the following prompt appears:
"Bringing up interface eth0: Device eth0 has different MAC address than expected, ignoring ."

In linux, how can I ensure that the modified MAC address is permanently saved? The correct steps are as follows:
# Ifconfig eth0 down
# Cd/etc/sysconfig/network-scripts
# Vi ifcfg-eth0
Modify "HWADDR = xx: xx" to "MACADDR = xx: xx"
# Ifconfig eth0 up
# Service network start

Keywords: HWADDR and MACADDR are different.

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.