3 ms·
There is a package called macchanger which is said to have the ability to spoof a random MAC address at each reboot. I have a new laptop with Ubuntu 14.04 fresh
by tombrossman 12y ago
There is a package called macchanger which is said to have the ability to spoof a random MAC address at each reboot. I have a new laptop with Ubuntu 14.04 freshly installed and I can't get it to work though. It's not a high priority but I would like to have this working soon. I used to do this about ten years ago on a laptop running XP and whatever program I was using worked flawlessly. I'm thinking it should be even easier in Linux but haven't found an 'it just works' solution yet.
- kyboren 12y agoIME the most reliable way to do this is with a udev rule. Here's my setup (Fedora, so YMMV). /etc/udev/rules.d/51-macchanger.sh: SUBSYSTEM=="net", ACTION=="add", DRIVERS=="iwlwifi", RUN+="/usr/local/bin/change-mac.sh wlp0s1" /usr/local/bin/change-mac.sh: #!/bin/bash ( if [ "$#" != "1" ] then echo "mac changer script must be given iface name as argument: $@" echo "Using default of wlp0s1 instead." iface="wlp0s1" else iface=$1 fi /usr/sbin/ifconfig $iface down /bin/macchanger -r -b $iface #change to any random MAC address /usr/sbin/ifconfig $iface up ) >/var/log/change-mac Note that you would need to specify the correct interface name in the udev rule (or figure out a way to get it dynamically--I never bothered). This also only works for Intel WiFi cards that use the iwlwifi driver; other cards with different drivers need their udev rule changed appropriately.