[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Random lladdr to ifconfig for ath0 - cannot connect

Hi all.

I'm setting up a laptop to generate test traffic against one of our APs so that we can look at logs, pf configs etc. We have a Dell C840 laptop with Proxim Orinoco 802.11b/g Gold PCMCIA card. As part of the testing, I'm changing the MAC on the wireless card and refreshing the dhcp assignment so that we have plenty of different sources in our logs. When we don't change the lladdr parameter in ifconfig, the wireless card can get a dhcp response, etc and works fine. When we change the MAC to something random with ifconfig and then associate, we get nothing.

I'm running gowire.sh (below) which calls a perl script to generate the random MAC. gowire downs the interface, applies the config and brings it back up again.

Maybe I'm doing something *really* daft here... Any ideas?

Many thanks.



print first_hex(), (":" . first_hex());
print rand_hex(), (":" . rand_hex()), for (0..3);

sub first_hex {
       return sprintf("%lx", rand(15) & 0xFE )

sub rand_hex {
       return sprintf("%lx", rand(15))


echo 'Bringing ath0 down...'
ifconfig ath0 down
sleep 5
echo 'Generating random MAC address and setting up connection...'
ifconfig ath0 lladdr `perl gen-random-mac.pl` nwid TESTNET chan 11 mode 11b -nwkey -bssid
echo 'Bringing ath0 up...'
sleep 5
ifconfig ath0 up
echo 'Looking for DHCP info...'
sleep 2
dhclient ath0
echo 'Done.'