Wednesday, April 20, 2016

Linux - Random MAC address at boot (systemd)

1. Determine you wireless adapter name:
$ iwconfig | grep 802.11bg

2. Create and edit /etc/systemd/system/macspoof@.service file for a new startup service as superuser / root
Description=macchanger on %I

ExecStart=/usr/bin/macchanger -r %I


3. Enable this script run each time you linux is booted
$ sudo systemctl enable macspoof@wlp2s0.service
* Note : Please replace "wlp2s0" with you adapter card name on step 1

4. Now reboot you computer and after booted, check you current MAC address:
$ macchanger --show wlp2s0
Current MAC:   ea:f7:07:3f:fa:b8 (unknown)
Permanent MAC: 25:7d:9f:uc:k7:c0 (Intel Corporate)

No comments:

Post a Comment