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