Linux: change Mac address - how it works
If you want to change the MAC address of your network card, this also works under Linux. We'll show you how it's done.
Step 1: Register as root in Linux
Note: In this practical tip we use the Linux distribution Ubuntu.
- Simultaneously press the [Ctrl] + [Alt] + [T] keys to open the terminal.
- Enter the command "sudo passwd root" there and confirm with the [Enter] key.
- Now type in your user password and the new, freely selectable root password.
- You can then log on to the terminal as an administrator using the "su root" command.
Step 2: change MAC address under Linux
Note: Only use numbers between 0 and 9 and letters from A to F when you select a new MAC address.
- Close the terminal according to the instructions above, open it again and log in with "su root" and the root password.
- The command "ifconfig eth0" shows you the current MAC address. Write this down. If there is a second network card in the PC, enter "ifconfig eth1".
- If you now enter the command "ifconfig eth0 down", the network card is deactivated. This is the only way to change the MAC address.
- With "ifconfig eth0 hw ether XXX" you can now change the MAC address. Set any MAC address for "XXX" like B3: 17: A1: 0C: 34: 26.
- You can then switch on and use the network card again using the "ifconfig eth0 up" command.