Macchanger is broke

So I’ve downloaded macchanger using DNF,

# sudo macchanger -r *interface*

this command works fine and gave me the new MAC-Address
but when the Network is up again and connect to internet it uses the original MAC-Address.
This program is really helpful, but now I’m using systemd for mac-address spoofing but the problem it changes the MAC on every boot, til now I didn’t find a way to change it without rebooting the system,
i hope there’s a solution for making macchanger works correctly

1 Like

There are various network configuration tools.
But, in many cases they are incompatible.
What is your final goal?

Actually macchanger is doing what I want but it didn’t work on fedora,
why macchanger is different because with simple command you can change your MAC-address to random one # sudo macchanger -r *interface* and another one you can revert it to the original # sudo macchanger -p *interface*

But now I’m using systemd the only problem, it automatically change the MacAddress on boot so if I want to change again I have to reboot the machine, I’ve tried Restarting NetworkManager.service but didn’t work.

systemd-networkd supports MAC address spoofing via [link files] (see systemd.link(5)

To set a static spoofed MAC address:

/etc/systemd/network/00-default.link

[Match]
MACAddress= *original MAC*
[Link]
MACAddress= *spoofed MAC* 
NamePolicy=kernel database onboard slot path

systemd-networkd is a separate service.
It’s best to disable NetworkManager if you want to use systemd-networkd.

1 Like

ok thanks , i will try this
is there any problems will happen if i disabled NetworkManager ?

It depends on your use case.

  • NetworkManager best suited for:
    • Desktop, Laptop
    • Manage connections dynamically
    • Desktop integration
    • Rich functionality
  • systemd-networkd best suited for:
    • Server, VM
    • Manage connections statically
    • Minimal dependencies

You can also perform MAC address randomization with NetworkManager:

1 Like

Thanks very helpful
I found the solution in fedora magazine :

2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.