๐ด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ Changing the MAC address on Debian ๐ฆ
Ronald Bartels
1 min read
The utility macchanger will be used which is installed as follows:
sudo apt-get install macchanger
Configure eth0 with a random mac address but maintain the vendor:
sudo macchanger -e eth0
Display the newly assigned mac:
sudo macchanger -s
Create a service to make this permanent (use the new mac address created above):
sudo nano /etc/systemd/system/macfix@.service
[Unit]
Description=Spoofing MAC address on %I
Wants=network-pre.target
Before=network-pre.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
[Service]
ExecStart=/usr/bin/macchanger -m 8c:1f:64:63:36:cf %I
Type=oneshot
[Install]
WantedBy=multi-user.target
sudo systemctl enable macfix@eth0.service
Now the device will always reboot with the changed mac.
2
Subscribe to my newsletter
Read articles from Ronald Bartels directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Ronald Bartels
Ronald Bartels
Driving SD-WAN Adoption in South Africa