Set MAC address fails - RTNETLINK answers: Cannot assign requested address

6

3

I am attempting to change the MAC address of eth0 to 3d:dd:c8:88:c2:0d on a linux mint 15 cinnamon machine. Using "ip link set dev eth0 address" fails as seen below and macchanger produces a similar error message("Cannot assign requested address"). As seen another MAC can be set, but I need this specific one.

Any suggestions as to how I can make the change or just why it fails?

~ $ sudo ip link set dev eth0 down
~ $ sudo ip link set dev eth0 address 3D:DD:C8:88:C2:0D
RTNETLINK answers: Cannot assign requested address
~ $ sudo ip link set dev eth0 address 00:00:00:00:00:01
~ $ sudo ip link set dev eth0 up
~ $ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:00:00:00:00:01  
          inet addr:172.26.24.158  Bcast:172.26.24.255  Mask:255.255.255.0
          inet6 addr: fe80::215:58ff:fecb:b9ba/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:885330 errors:0 dropped:0 overruns:0 frame:0
          TX packets:643599 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:840836259 (840.8 MB)  TX bytes:429278582 (429.2 MB)
          Interrupt:16 Memory:ee000000-ee020000 

kidmose

Posted 2014-03-06T12:47:10.083

Reputation: 312

Answers

22

MAC addresses have two special bits in the first byte:

  • Bit 0 is the "multicast" bit, noting that the address is a multicast or broadcast address
  • Bit 1 is the "local" bit, indicating that the MAC address was not assigned by the vendor and might not be entirely unique.

You are trying to set an address that has the multicast bit set, which does not work because any reply to your host would be interpreted as a multicast packet.

Also, when you change a MAC address and do not have an OUI assigned to you, please set the local assignment bit.

Here's a diagram that may help give more detail:

MAC address diagram

Simon Richter

Posted 2014-03-06T12:47:10.083

Reputation: 2 384

I created an account here just to upvote this. I had used an online tool to generate multiple mac addresses, and that online tool didn't take this into account. That lead to very weird behavior on my local network. After manually modifying the first octet everything worked perfectly. – maxb – 2019-08-05T18:08:20.550