Posts: 15
Joined: Fri Nov 16, 2018 8:19 pm

How to Spoof MAC at Every Boot [Help]

Mon Nov 26, 2018 5:03 pm

Last edited by ahududu on Wed Mar 13, 2019 6:41 pm, edited 1 time in total.

Posts: 3756
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: How to Spoof MAC at Every Boot [Help]

Tue Nov 27, 2018 11:20 am

Are you using raspbian or Arch as your OS?

What version of the OS are you runnings?
Need Pi spray - these things are breeding in my house...

Posts: 9871
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How to Spoof MAC at Every Boot [Help]

Tue Nov 27, 2018 6:57 pm

Leave the '99' file alone. It's there for all the standard cases. (I think it's actually pointing to /dev/null)

Create a file in /etc/systemd/network. The only important part of the name is the number, because
You want the file to be executed before '99' so the easiest is to start it with '00' (if you need more than one file you just increase the number).
I would make the rest of the name something related to the target device, e.g. eth0

So create e.g. /etc/systemd/network/00-eth0.link with these contents:

Code: Select all


The Match block determines which device is going to be spoofed. In this case it's eth0. You can choose other characteristics, such as the old MAC address. See the docs linked to below for more detailed info.

The Link section determines the new MAC address.
That's it. Save the file and reboot the Pi and to activate the new setting.

More documentation:
https://wiki.archlinux.org/index.php/MA ... s_spoofing
https://jlk.fjfi.cvut.cz/arch/manpages/ ... emd.link.5
https://serverfault.com/a/40720 (locally administered Mac addresses)

Return to “Networking and servers”