How to change MAC address in Lnux
This method is tested with Ubuntu, but I think it should also work with many other distributions as well. To change your MAC address in Linux just follow the steps below.
1. Open the terminal and type “ifconfig”
2. Find the interface you want to change the mac address. If you have more than one network adapter installed on your machine, they are usually numbered as “eth0″ ,” eth1″ and so on.
3. Run the following command:
ifconfig <interface> down hw ether < new mac address >
This command stops the selected interface and changes its mac address. Note that you have to be either logged as ROOT or type “sudo” before every command or you will receive ” Permission denied” as a result.
Then the command will looks like this:
sudo ifconfig <interface> down hw ether < new mac address> .
You will be asked for the root password.
4. Now turn on the interface with the command: ifconfig <interface> up
For example, theĀ above commands may look like:
ifconfig eth0 down hw ether 00:19:B9:7A:C9:A1
ifconfig eth0 up
The only disadvantage of the described method is that after restart of the computer your MAC address will change to its default value. If you want to make it permanent even after restart, you have to edit the /etc/network/interfaces file and add following line in the section containing the settings of the selected network adapter so that the MAC address to be set when the device is started.
hwaddress <interface> < New MAC address >
For example : hwaddress ether 00:19:B9:7A:C9:A1
Here is part of my /etc/network/interfaces file after being edited:
iface eth1 inet dhcp
hwaddress ether 00:19:B9:7A:C9:A1
address 192.168.1.3
netmask 255.255.255.0
gateway 192.168.1.1
wireless-essid cartoon_network
auto eth1


