Modify the MAC address in Linux

Source: Internet
Author: User

Modify the MAC address in Linux
Method 1:

1. Disable the NIC Device
Ifconfig eth0 down
2. Modify the MAC address
Ifconfig eth0 hw ether MAC address
3. Restart the NIC
Ifconfig eth0 up

Method 2:
After the preceding method is modified, the MAC is restored to the original MAC after linux is restarted. To make the modified MAC still valid at next startup, we can modify the file:/etc/rc. d/rc. sysinit (RedFlag Linux is the file, and linux of other versions should be different:
Ifconfig eth0 down
Ifconfig eth0 hw ether MAC address
Ifconfig eth0 up

Method 3:
Very simple, just add the following sentence to./etc/sysconfig/network-scripts/ifcfg-eth0:
MACADDR = 00: AA: BB: CC: DD: EE
Method 4:
How to change the nic mac address in Linux
--------------------------------------------------------------------------------

You can add the following commands to the/etc/rc. d/rc. sysinit file:
Ifconfig eth0 down
Ifconfig eth0 hw ether xx: xx
Ifconfig eth0 up
Because this script runs before the network, MAC and IP are the corresponding
Method 5:
Change the MAC address in Linux
First, use the command to disable the NIC device.
/Sbin/ifconfig eth0 down
Then you can modify the MAC address.
/Sbin/ifconfig eth0 hw ether xxxxxxxxxxx
(Xx is the address you want to modify)
Enable Nic
/Sbin/ifconfig eth0 up
The MAC address of the NIC is changed.
 
 
----------------------------------------------------------------------------------
Modify/etc/sysconfig/network-scripts/ifcfg-eth0, add HWADDR: xxxxxxxxxxxx, MACADDR: XXXXXXXXXXX (disguised mac address)
This article is from the "Network Design" blog

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.