/security
OpSec

network

Automatic MAC spoofing

The easiest way to change the MAC address of a Linux’ NIC is to use macchanger that, by default, sets a random address using macchanger -r <name_of_the_interface>. However, You need to set the interface down before doing so, which you might not do often enough as a lazy fuck you are (myself included).

So, to execute it systematically at startup on a systemd based Linux system, simply create the following unit /etc/systemd/system/macspoof.service (change wlan0 with the interface of your choice).

[Unit]
Description=macchanger on wlan0
Wants=network-pre.target
Before=network-pre.target
After=sys-subsystem-net-devices-wlan0.device

[Service]
ExecStart=/usr/bin/macchanger -r wlan0
Type=oneshot

[Install]
WantedBy=multi-user.target 

Reload the units

systemctl daemon-reload

Enable the service macspoof.service

systemctl enable macspoof.service

Et voilĂ . Check with ip addr and compare it with the one after your next boot

zar3bski

DataOps


When it comes to anonymity, lower levels of the OSI model tend to be neglected. However, keep in mind that, for any router and for all IOT devices sniffing your network, your identity really is the Media Access Control (MAC) of your network interface

By David Zarebski , 2025-10-23