Random MAC Address for Linux Network Interfaces
For all of these options first install macchanger
.
sudo DEBIAN_FRONTEND=noninteractive apt install macchanger
Random MAC for every NIC
Create a file at
/etc/udev/rules.d/81-mac-spoof.rules
like so.
ACTION=="add", SUBSYSTEM=="net", RUN+="/usr/bin/macchanger -r $name"
Random MAC for a specific NIC
If the original MAC address of the NIC was
dc:a6:32:d0:7b:de
then create a file at
/etc/udev/rules.d/81-mac-spoof.rules
like so.
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="dc:a6:32:d0:7b:de", RUN+="/usr/bin/macchanger -r $name"
Notes
Feel free to contact me with questions or feedback regarding this
article.