OpenWrt Forum Archive

Topic: mac address of wireless interface

The content of this topic has been archived on 31 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I have built the svn rev #12820 and installed on an Asus WL500gP with Broadcom wifi.
The question is: how to change the mac address of the wireless interface? I tried the command "ifconfig $ifname hw ether $macaddr" which has changed the address. However, the command "ifconfig" shows the new address, but clients see the old address (e.g. using the command "iwlist scanning") and therefore cannot connect.
I found nvram entries for mac address of the wired interfaces, but not for wireless.

Thanks in advance
K. Gy.

Which kernel? 2.6.x with b43 or 2.4.x with brcm-wl?

You need to set the MAC address of the bridge as well as the MAC address of the wifi interface.

I noticed that setting the MAC address of the wireless interface usually only changes the address of the Wireless AP.  But the bridge (which has an IP address) will keep the old mac address.
Similarly, if you change the mac address of the bridge, but not that of the AP, the AP will keep its old mac address while 192.168.1.1 will change.

You can test this by also looking running "arp -an" and comparing it to "iwlist wlan0 scan"  Arp will show the address of the bridge while iwlist will show the MAC of the wireless interface.

Also, in order to set the MAC address of the interface, you may have to remove it from the bridge with "brctl delif br-lan wlan0", bring the wireless down, change the mac address, run "wifi" and then add it back to the bridge.  It depends on the wireless driver you are doing--some may let you do it while the interface is up.

My kernel is 2.4.35.4

Now i am totally confused about mac addresses.
According to ifconfig, my bridge have the mac address of eth0. I set a different one for wl0, while the 'iwlist scan' and 'arp -an' commands (on another machine) shows the old value of wl0.

The discussion might have continued from here.