4

I want to change the mac address of eth0 of my Raspberry Pi.
I haven't any problems with the wlan0 (macchanger -A wlan0 works)

General information: I have

  • a Raspberry Pi Model B
  • with Arch Linux ARM (archlinux-hf-2013-06-06)

I used

# macchanger -A eth0 

and get this result

Current MAC:   b8:27:eb:bc:d5:fd (Raspberry Pi Foundation)
Permanent MAC: 00:00:00:00:00:00 (Xerox Corporation)
[ERROR] Could not change MAC: interface up or insufficient permissions: Device or resource busy

and

# ifconfig eth0 down hw ether 01:02:03:04:05:06

with this error

SIOCSIFHWADDR: Cannot assign requested address

I googled a bit and found this. I think there is someone with the same problem but I can't find a solution.

The question is now: Why i get these error messages (when do macchanger / ifconfig makes such an output?) and maybe what can I do to remove them and finally change the mac address?

1
  • would you prefer a C code to do the MAC setting?
    – askmish
    Commented Jul 31, 2014 at 12:11

3 Answers 3

4
  1. Write a script

    #!/bin/sh
    
    ifconfig eth0 down hw ether 00:00:00:00:00:00
    ifconfig eth0 up
    

where "00:00:00:00:00:00" - your mac address Let's say you called it mac.sh.

  1. Put it in the /etc/init.d/ directory. And make this file executable using # chmod +x mac.sh

  2. Then run: # update-rc.d mac.sh defaults

That's make your script bootable.

  1. After rebooting mac will be changed

I got this from internet.

0
3

Did you forgot sudo? So try sudo macchanger -A eth0 And why you want to change the mac address?

2
  • no i was logged in as root (look at the '#', if you are a normal user you will get a '$')
    – Fabian N.
    Commented Jul 11, 2013 at 20:00
  • Ow sorry! I probably looked over it! Commented Jul 11, 2013 at 21:52
1

Just add smsc95xx.macaddr=00:00:00:00:00:00 to /boot/cmdline.txt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.