Spoofing a MAC address on Linux

Spoofing a MAC address on Linux is quite easy. It does require that you shut the interface down however. Shut the interface you want to spoof down, and then run ifconfig.

ifconfig eth0 down ifconfig eth0 hw ether 00:11:22:33:44:55 ifconfig eth0 up
Leave A Reply - 3 Replies
Replies
October 3rd 2006 - dave

thanks. that was even easier than i thought. matlab uses the mac address for verification, so when i motherboard with builtin ethernet blew up, i was locked out. now i'm no longer locked out, and can figure out the proper way when i have the time. :)

March 5th 2007 - john

this does not always work, for instance with a wireless card using ndiswrapper you need to change your .conf file withing your driver's folder located in /etc/ndiswrapper/

which reportedly works, you simply change the line mac_address|XX:XX:XX:XX:XX:XX to mac_address|

I do not currently have that working on gentoo linux at the moment however it's worked for a couple people out there and it -is- the method listed for the wiki. simply bringing the wlan0 down and ifconfig wlan0 hw ether does not work with my gentoo build using ndiswrapper it seems to be overwritten w/ the real mac address repeatedly.

March 12th 2010 - felipe1982.com

To make permanent in openSUSE, edit /etc/sysconfig/network/ifcfg-*, add the line "LLADDR=00:11:22:33:44:55." Save/reboot

All content licensed under the Creative Commons License