Re: How can I clone a mac address on wlan0?

From: Bernhard Schmidt <bschmidt_at_freebsd.org>
Date: Tue, 29 Mar 2011 13:06:57 +0200
On Tuesday, March 29, 2011 08:38:43 Doug Barton wrote:
> For a variety of boring reasons I need to clone a mac address on wlan0. 
> The documented way to do this:
> 
> ifconfig wlan0 create wlandev wpi0 wlanaddr 00:11:22:33:44:55:66
> 
> works in the sense that it sets up the interface with that mac, but then 
> the wlan0 interface never associates. Doing everything the same but 
> omitting the wlanaddr argument (which causes wlan0 to use the mac of the 
> wpi0 device) works.
> 
> This also doesn't work in 8.2-RELEASE, so either we've got a 
> long-standing bug, or I'm doing something very wrong. The wpi0 card is 
> an intel 3945abg, I also have a couple of ath cards I can try (although 
> so far they haven't worked either).

I doubt the wlanaddr option is what you are looking for. This option
is only used (and valid) in multiple VAP setups. The BSSID is used to
filter frames, everything not to the BSSID (or multicast/broadcast)
gets dropped. With multiple VAPs you want to use different BSSIDs for
each AP. There are two options to achieve that, using the "bssid"
parameter which will generate a semi random MAC (based on the
hardware's MAC address) or the "wlanaddr" parameter which allows a user
to define the complete address. Whether the hardware does support
setting multiple BSSID filters is another story, I doubt we have one
in tree.. mostly the addresses are generated in such a way that for
example either the first 4 or last 4 bits are changed and therefore
a "wildcard" filter can be used. Now to the point, wpi(4) has no
support at all for multiple VAPs.. therefore no one ever had a look at
that.

Anyways.. you might want to look into the "link" option, changing the
wpi0's MAC will also change the one of wlan0.

-- 
Bernhard
Received on Tue Mar 29 2011 - 09:07:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:12 UTC