Sys-net: random MAC spoofing and random hostname (optional) automated on every boot without installing anything

Problems of not doing MAC spoofing on sys-net:

The ISP could collect your real MAC, sell it, or use it for malicious purposes!
The original MAC is associated with whoever bought the PC with the original MAC; therefore, on any network, even when using Qubes OS, without MAC spoofing they will be able to discover who owns that MAC by checking invoices from suppliers, stores, etc… that’s why you need to do MAC spoofing in everything!

Solution:

  1. Configure the template that is used by sys-net with
    setting, services, add network-manager
    Enter in the template and:
sudo cat > /etc/NetworkManager/conf.d/00-macrandomize.conf << 'INNEROFF'

[connection]
ethernet.cloned-mac-address=stable
connection.stable-id=${CONNECTION}/${BOOT}
INNEROFF
sudo systemctl restart NetworkManager

In Qubes 4.3, for example, sys-net uses the default template debian-13-xfce!
If sys-net is a disposable template that uses default-dvm as a disposable template, then the template of default-dvm is default-template debian-13-xfce!
In the case of WiFi, sys-net already randomizes the MAC by default by Qubes! Ethernet does not!

Fingerprint in Qubes: hostname is unset (empty), and that can be a problem! Manual solution for certain contexts!

This is a Qubes fingerprint, because by default it doesn’t display the hostname. This is metadata that allows a forensic attacker who has access to your personal router’s logs: if you connect directly to your ISP router or any other external/public network, all devices may have hostnames probably, but with Qubes you won’t — so it becomes inferable that you’re using Qubes, since it’s characteristic of Qubes to use an empty hostname, while most devices have some hostname set by default on the network!
Tails also has a default hostname unset. This is metadata that can be inferred as being Tails or Qubes (or another anonymity OS with the same characteristic)!
This is metadata that can help investigators in researching and correlating certain of your activities in your network ou other!

The ideal is to look like the other devices in the network. One solution is:
Qubes with hostname unset, and all other devices in the network also have hostname unset (empty) too, and then you’ll need to configure this manually on all of them (I mean your home network).

Change hostname manually in Qubes to blend in with other devices and look like them!

Alternatively, if you need, you can set a hostname in sys-net on each login with:

  1. Disconnect the Ethernet cable or don’t connect to WiFi. Stay offline, make the hostname change first, then connect!
sudo ip link set enk2s0 down
sudo hostnamectl set-hostname YOUR-CUSTOM-HOSTNAME
sudo hostnamectl status
sudo ip link set enk2s0 up

When using the ip link commands to bring the interface up and down, you may get some command output errors, but in tests it always disconnects and reconnects, and the hostname change still takes effect.

Connect to the internet!
Random MAC + custom hostname in sys-net!
Now the Qubes will also have a hostname that resembles the other devices in the network, avoiding those metadata leaks!
In this case, the ideal is to use the sys-net named disposable, which you can choose during installation, so it will always return to hostname unset when needed again. You’ll just have to restart and you’re done!

For me, it’s working well — there’s no leakage of the real MAC address in the tests I ran. If anyone has any issues, please let me know!

Note

The post was edited because many people complained about adding MAC spoofing for Wi‑Fi, since Qubes already does that by default. They also complained about the MAC being randomized using OpenSSL; the ideal approach is to use a MAC with an OUI and set ethernet.cloned-mac-address=stable, using nmcli the way Qubes does by default.
Previously, everything was configured directly in /rw/config/rc.local inside the sys-net or its disposable templates; however, if sys-net or the disposable template gets “bugged,” then /rw/config/rc.local won’t work, which happens in many cases. Sometimes you have to repair sys-net and create a new one for /rw/config/rc.local— at least that happened to me once and I had to repair it.
Other AppVMs or disposable VMs that use the Debian 13 XFCE template (default template) are not affected in the tests.
If you prefer, you can clone the default template, make this configuration, and configure sys-net to use it—leaving the original default template as-is!

I ask the moderators to change the post title, since I can’t edit it!

1 Like
1 Like

mac-randomization is an existing feature on NetworkManager.
Also, your script would let the interface first connect with its original address and then reconnects with a new one :slight_smile:

Also, not hostname randomization but hostname anonymization is also possible with NetworkManager. Which might be better then choosing out of 4 prefixes …

7 Likes

At first I thought, wait? Then I though I was missing something, then the 2 last post were did sanity check for me. Then I am: maybe we all are missing something? So, still waiting, hahahah

3 Likes

I know right? Its like you forgot your house keys in your car and you don’t want your neighbor to see you walk out there again so you use a granade to open the door waking everyone in 5km up

NetworkManager’s Mac changer ACTUALLY USES correct vendor macs, on the other hand the above method gives ME chills, smart but dangerous

3 Likes

This is a very good example of a bad AI ‘contribution’ attempt, right?! :smiley:

I’m used to silently ignore the ‘not so useful’ tips popping up here, but this is what I whould flag as harmful ‘suggestion’ and I would remove from this forum.

5 Likes

This is just another “how to do something you can achieve with a shell oneliner but with XXX LOC instead” guide. I don’t think there is a policy to remove that kind of guide, and I’m now too lazy to put a warning in front of them.

2 Likes

WRONG: it wasn’t done with AI!

The algorithm and the setup architecture were designed by me. It’s not a perfect solution, but it’s what I managed to create.

If you don’t like it, do better! Or ban me from the forum if you want “perfect” solutions.

Instead of complaining that the algorithm isn’t good, that it’s AI slop, etc., it’s low quality and Network Manager does MAC spoofing better and more securely, etc.—why don’t you post the complete solution instead of just complaining?

Answer with the perfect divine guide you want. Work on it!

Post a complete tutorial with the solution for MAC spoofing for sys-net over Ethernet in Qubes, because in Qubes MAC spoofing automatically works by default and perfectly only if it’s Wi‑Fi; if it’s Ethernet, it doesn’t. And that’s a problem argued and proven in that post—period!

2 Likes

Untested, but I think a minimal, modern approach would be something like:

  • For Wi-Fi MAC randomization, no action is necessary because it is done by default (with stable randomization per connection profile, per boot) in /usr/lib/NetworkManager/conf.d/31-randomize-mac.conf

  • For Ethernet MAC randomization (with a new random address each time any link goes up), create e.g. /etc/NetworkManager/conf.d/32-randomize-mac-ethernet.conf containing

    [connection]
    ethernet.cloned-mac-address=random
    
  • To disable sending the hostname to the DHCP server, normally no action is necessary (AFAIU) because NetworkManger only does that if /etc/hostname exists - which is normally not the case in a VM like sys-net. To disable it even if /etc/hostname exists, create e.g. /etc/NetworkManager/conf.d/33-dhcp-no-hostname.conf containing

    [connection]
    ipv4.dhcp-send-hostname=0
    ipv6.dhcp-send-hostname=0
    
    [.config]
    # Debian 13+, Fedora 42+
    enable=nm-version-min:1.52
    

    This^ is the configuration suggested in the Arch Linux wiki, so it’s probably a fairly common way to do it. I doubt that not sending any hostname looks particularly spicy to an observer.

Again, untested. I’m planning to submit both of these upstream to qubes-core-agent-linux (with Ethernet MAC randomization installed but inactive by default). Maybe someone could give them a try?

4 Likes

I second this, this is the equivalent of 1800s doctors prescribing cocaine for a child’s cough when a light sleep in a warm bed would suffice

2 Likes

??? A simple google search will give you enough information to drawn for an hour or so all showing you how to do this using network manager, rustybird probably took 3 minutes out of his life to make a post for you on that

If you want to make a program out of curiosity and an “I can do this” attitude that randomizes macs and hostnames go for it but don’t post it on a forum where some user’s life or even their family’s could depend on it if they live in the wrong part of the world, that is pure malice and I cannot accept any other argument about it period!

And if you really want to know WHY your method is so wrong is not JUST the fact that it leaks data but the fact that you haven’t taken into account that the first half of a Mac address is LOCKED IN to the manufacturer, each manufacturer has their own Mac address space they can legally use, and as far as I know the NetworkManager programmers had a few more braincells that morning and decided to keep a list of all manufacturer Mac address (OUI) so whenever you randomize your Mac address you can get one that at least LOOKS real, so well done, whoever was ignorant or non-tech savvy enough is now logged by cloudflare , google and any other capcha provider as a potential bot so you might have blacklisted a few residential IP addresses as well

If this WAS NOT created with AI then you should have at least asked Venice ai or arli ai for some advice or something, Jesus

2 Likes

Can someone vet this account? There are enough security guides by this profile that one would expect they are an expert but it appears they don’t understand network security 101, a community member has already edited one of his posts as it was potentialy ai slop, this could seriously put users at risk if it goes on

“Oh look I know how to change your bicycle’s tire, first you use a chainsaw to remove the frame of the bicycle…”

2 Likes

What you’re saying makes no sense, and what many people are criticising is also beside the point. The aim of the post and the method is to stop them discovering the real MAC address by using random MACs in Qubes, where, with a wired connection, the real MAC remains visible!

By using MAC changer with the -r (random) option, it does exactly that! But in this tutorial the author uses OpenSSL—perfectly hides the MAC.

MAC changer uses a random MAC too, and it’s able to hide the real MAC. That’s the point! The point is to have no OUI, no manufacturer—hide the real MAC, end of story. If someone uses MAC changer in the -r <mac> mode, are they doing it wrong now?

But he’s hiding the real MAC, isn’t he?

So why does it need an OUI now if the goal (to hide the real MAC) has been achieved?

Having a real manufacturer MAC is optional, especially if you’re at home and your goal is to stop your ISP from knowing your MAC. I use this on my Fedora and also on Windows. I use a random MAC with no OUI—am I wrong now?

Using it with an OUI or without it depends on each person’s goal. I didn’t see anything wrong with this guide—only one issue: the author got the Wi‑Fi MAC wrong, because Qubes already handles that automatically for me, both over USB Wi‑Fi and PCI Wi‑Fi.

1 Like

Hm, I use the following for a long while:

#resources:
#https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/examples/nm-conf.d/30-anon.conf
#https://github.com/Qubes-Community/Contents/blob/master/docs/privacy/anonymizing-your-mac-address.md
#`man nm-settings`
[connection]
ethernet.cloned-mac-address=stable
ipv6.dhcp-duid=stable-uuid

As well as:

#don't send the hostname over DHCP
[connection]
ipv4.dhcp-send-hostname=false
ipv6.dhcp-send-hostname=false

#https://github.com/QubesOS/qubes-issues/issues/10706
[main]
hostname-mode=none
3 Likes

YES, perfect example, look at this guy

Aleem probably has no idea that that script leaks data, is blacklisting him or alternatively is making centralised captcha trackers take very special interest in him, by any accounts he is our special victim number 1, now all we need is to insert someone in cloudflare, google, or an intelligence service to see how they keep track of him by the unique identifiers he leaves behind by being ignorant enough to use such a script

2 Likes
Inappropriate: use of sexualized language

A friend told me once: “Yeah, I go out and hide my d1ck hoping no one will recognize me. I can even barely hide myself in my own home”.
I was: “Wow, was your d1ck so recognizable?”

1 Like

Well from the point of view of trackers, completely random macs rather then OUI based random macs stick out A LOT more, to use your analogy it is like having an umbrella shaped dk, so yes quite

Edit: grammar

2 Likes

Yet no tracker would see the mac cause wrong layer …

The only one how will notice is the network operator. May it be the ISP via TR-64 on your router or who ever owns the public wifi you connect to.

For your home-network, you have bigger issues.
For an open wifi it does not matter how you obscure it.

2 Likes

Using nmcli (network manager) for mac spoofing with OUI is FALSE! It always fails!

On Qubes OS, the automatic randomized MAC for Wi‑Fi — if you test it on the network with nmap or wireshark or netdiscover using:

If the Qubes IP with the Wi‑Fi card is 192.168.0.100, for example:

sudo nmap -sn 192.168.0.100

or using wireshark, netdiscover, arping, arpscan looking for the IP 192.168.0.100

THE MAC IS ALWAYS UNKNOW, ALWAYS UNKNOW! nmcli doesn’t work!

For Ethernet it’s the same crap: configuration in a file created in NetworkManager — for example

sudo nano /etc/NetworkManager/conf.d/stable-mac-nmcli.conf
[connection]
ethernet.cloned-mac-address=stable
ipv6.dhcp-duid=stable-uuid

or

sudo nano /etc/NetworkManager/conf.d/stable-mac-nmcli.conf
[connection]
ethernet.cloned-mac-address=random
ipv6.dhcp-duid=stable-uuid

in the case of ethernet.cloned-mac-address=random it will always be unknown MACs.

in the case of ethernet.cloned-mac-address=stable, it FAILS MISERABLY, ALWAYS!

Do the test with nmap, wireshark, netdiscover, arping, arpscan and others!
It always fails!

The macchanger tool with options macchanger -a or macchanger -A, NEVER fails! It always shows a MAC with the correct OUI and perfect results where it appears in the scan — the manufacturer of the MAC used will always appear! It never failed for me!

So if someone says NetworkManager is perfect and does MAC spoofing with OUI, do the test and see if it works like macchanger!

IT DOESN’T WORK! You’re promoting using a tool that fails at hiding a MAC with a correct OUI and showing the scan really as the falsified manufacturer!

Test it and see for yourself!

Either you generate a fake MAC with the correct OUI and do it manually using ip link or other settings in Linux, or use macchanger with options -a or -A or another tool that works, scan to check and use it but

NetworkManager doesn’t work, it never worked for me with ethernet.cloned-mac-address=stable!

You’re the one promoting using NetworkManager for MAC spoofing with OUI — you’re very wrong; it fails miserably!

Use nmcli with ethernet.cloned-mac-address=stable or use OpenSSL to generate random MAC addresses; both will result in unknown/random MACs.

1 Like

You’re the one promoting using NetworkManager for MAC spoofing with OUI — you’re very wrong; it fails miserably!

Use nmcli with ethernet.cloned-mac-address=stable or use OpenSSL to generate random MAC addresses; both will result in unknown/random MACs.

YOU NEED USE macchanger -A or macchanger -a nmcli do not work! Scan with nmap, netdiscover or wireshark your qubes to test!

1 Like