Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Mar 2011 10:20:29 -0400 (EDT)
From:      Daniel Eischen <deischen@freebsd.org>
To:        Doug Barton <dougb@freebsd.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: How can I clone a mac address on wlan0?
Message-ID:  <Pine.GSO.4.64.1103291010160.24637@sea.ntplx.net>
In-Reply-To: <4D917E73.9080809@FreeBSD.org>
References:  <4D917E73.9080809@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 28 Mar 2011, 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).

Since wireless went to the cloned wlan device, this hasn't
worked.  Clone devices don't push the MAC addresses down
(at least the wlan clone doesn't).  I reported this problem
with lagg failover between wired and wireless.  Obviously
I wanted the wired connection as the primary and the wlan
device as secondary, so lagg would always end up using
the wired connection's (xl0 in my case) MAC address and
then trying to change wlan0's MAC address to the same when
it was selected during failover.

So I had to put this:

   ifconfig_ath0="ether 00:08:74:4b:88:b2"
   wlan_ath0=wlan0
   ifconfig_wlan0="ssid FOO_SSID wepkey1:..."
   ifconfig_xl0="up"
   cloned_interfaces="lagg0"
   ifconfig_lagg0="laggproto failover laggport xl0 laggport wlan0"
   ifconfig_lagg0_alias0="inet a.b.c.d netmask 0xffffff00"

into rc.conf.  ath0's MAC is my primary's (xl0) actual MAC
address.

So I'm guessing if you put ifconfig_wpi0="ether 00:11:22:33:44:55:66"
in rc.conf, that would work.

-- 
DE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.1103291010160.24637>