From owner-freebsd-current@FreeBSD.ORG Tue Mar 29 11:07:37 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9FAC1065672 for ; Tue, 29 Mar 2011 11:07:37 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 769C18FC1D for ; Tue, 29 Mar 2011 11:07:35 +0000 (UTC) Received: by fxm11 with SMTP id 11so111670fxm.13 for ; Tue, 29 Mar 2011 04:07:34 -0700 (PDT) Received: by 10.223.10.141 with SMTP id p13mr778222fap.109.1301396854572; Tue, 29 Mar 2011 04:07:34 -0700 (PDT) Received: from jessie.localnet (p5B2ECDCE.dip0.t-ipconnect.de [91.46.205.206]) by mx.google.com with ESMTPS id 14sm1905153fae.47.2011.03.29.04.07.32 (version=SSLv3 cipher=OTHER); Tue, 29 Mar 2011 04:07:33 -0700 (PDT) Sender: Bernhard Schmidt From: Bernhard Schmidt To: Doug Barton Date: Tue, 29 Mar 2011 13:06:57 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.32-30-generic; KDE/4.4.5; i686; ; ) References: <4D917E73.9080809@FreeBSD.org> In-Reply-To: <4D917E73.9080809@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103291306.57476.bschmidt@freebsd.org> Cc: freebsd-current@freebsd.org Subject: Re: How can I clone a mac address on wlan0? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bschmidt@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2011 11:07:37 -0000 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