Thousands of Deadly Islamic Terror Attacks Since 9/11

Categories

Search

Add to Technorati Favorites

Proud veteran of the United States Army

(AFIP deactivated with Walter Reed under BRAC, SEP 2011, Office of the Armed Forces Medical Examiner reactivated as Armed Forces Medical Examiner System (AFMES) under US Army Medical Research and Materiel Command)

(PROFIS to units below)

(520th TAML was deactivated in 2004 to form 1st and 9th AML)

Randomizing (spoofing) MAC address in Fedora 16 linux

October 29th, 2011 by admin

Update: The instructions for Fedora 19 are here.

Update:  This stopped working when I upgraded to Fedora 17 — it seems NetworkManager gets turned on earlier in the boot sequence.  My  fix for Fedora 17 is here.

I like to randomize my MAC address when I boot my laptop, mostly as a basic protective measure for a box I use when I travel.  There are a number of good posts for doing this in Ubuntu, but I didn’t see much for Fedora that  didn’t require turning off the Network Manager.  So, I’ve been poking around.  Right now, I’m playing with Fedora 16 beta.

 

Turns out it’s not that hard.    It *seems* (though this is from a rather scattershot attempt at a solution) that you have to change the hardware address *before* any networking software starts — be it network intialization, network manager, whatever.  Of course, in linux, setting the hw address is trivial using the ifconfig command.  For instance, for wlan0, you might use

ifconfig wlan0 down

ifconfig wlan0 hw ether 11:22:33:44:55:66

ifconfig wlan0 up

Personally, though, I don’t like this method because I don’t know anything about how MAC addresses are assigned to companies, etc., and I have had problems with public connections using truly random numbers.  Happily, there is the wonderful progam called “macchanger” available from most repositories that will provide a more intelligent change.

So, the question becomes *when* to run it.  There are basically three options:  before networking gets started altogether, after networking gets going, but before NetworkManager is invoked, or after NetworkManager is invoked.

The last one, just runining macchanger as root, just doesn’t work. I get the error:

%macchanger -a wlan0
Current MAC: 00:00:41:04:21:48 (Ice Corporation)
ERROR: Can’t change MAC: interface up or not permission: Device or resource busy.

So, I tried putting it in  as a script in /etc/NetworkManager/dispatcher.d as an early script.  Same error.

Finally, I said screw it, and created a script in /etc/init.d called macchangerd that looks something like:

 

#!/bin/bash
#
#

start() {
echo "in macchangerd"
macchanger -a wlan0
}

# See how we were called.
case "$1" in
start)
start
;;
*)
echo $"Usage: $prog {start}"
exit 1
esac

 

 

Make sure that the script is executable.  Also, replace wlan0 with the name of the wireless device on your machine — it may be something different.

Then, I just added a line to /etc/rc.d/rc3.d:

ln -s /etc/init.d/macchangerd /etc/rc.d/rc3.d/S04macchangerd

I made it 04 in order to put it before any networking stuff.

 

And it seems to work.  My wireless device (wlan0) comes up with a different MAC address every time I boot,and I can connect — at least to my home network.

Update:  I’ve noticed a few hits each day on this post from folk searching this topic on search engines.  If anybody out there gives this a try on their box, give some feedback in the comment to let folk know that it worked for you, or if not, what went wrong.  Thanks!

Posted in Uncategorized | 7 Comments »