0

I set my mac address for the wifi chip via:

/sbin/ifconfig wlan0 down                                                          
/sbin/ifconfig wlan0 hw ether ${WIFI_MAC_ADDR}    
/sbin/ifconfig wlan0 up    

Say the default mac address is 98:00:00:00:00:00. I if change the mac address to any new address that still starts with 98, then I have no problem.

However, if I change the 98 to any other number, then I get the following error:

wlan0: set cur_etheraddr failed
dhd_sysioc_thread _dhd_set_mac_address() failed

Why?

1 Answer 1

1

The least significant bit of the first octet is reserved as the "group bit" (multicast/broadcast flag bit). MAC addresses with that bit set are not valid unicast addresses, thus are not valid to use as the MAC address of a NIC.

So in the nibble where you have a 0x8, these (even) values are legal:

0x0
0x2
0x4
0x6
0x8
0xa
0xc
0xe

And these (odd) values are illegal:

0x1
0x3
0x5
0x7
0x9
0xb
0xd
0xf
2
  • Wow thanks. So is that true for all WiFi Mac Addresses? The least significant of the first octet has to be even?
    – Kousha
    Apr 29, 2015 at 19:57
  • @Kousha That's right, the one's place bit of the first octet must be clear (zero). Also, when setting your own MAC address, it's best practice to make sure the two's place bit of the first octet is set (one). That's because that bit is the "local" bit, which means it's a custom MAC address you set yourself, not a factory-set (guaranteed to be globally unique) MAC address.
    – Spiff
    Apr 29, 2015 at 20:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .