Everything is done as root.
The classic one is using "ifconfig".
I do an example with wlan0.
Stop interface:
systemctl stop NetworkManagerChange the MAC:
ifconfig wlan0 hw ether XX:XX:XX:XX:XX:XXwhere XX:XX:XX:XX:XX:XX is your desidered MAC
Start interface:
systemctl start NetworkManagerNow you will connect using NetworkManager (as usually) with XX:XX:XX:XX:XX:XX as MAC.
Every reboot it's reset to the original one.
Another useful tool is "macchanger".
Usage: macchanger [options] deviceTo do the same work as above:
-h, --help Print this help
-V, --version Print version and exit
-s, --show Print the MAC address and exit
-e, --endding Don't change the vendor bytes
-a, --another Set random vendor MAC of the same kind
-A Set random vendor MAC of any kind
-r, --random Set fully random MAC
-l, --list[=keyword] Print known vendors
-m, --mac=XX:XX:XX:XX:XX:XX Set the MAC XX:XX:XX:XX:XX:XX
systemctl stop NetworkManager
macchanger --mac=XX:XX:XX:XX:XX:XX wlan0
systemctl start NetworkManager
This can even set random vendor MAC of the same kind:
systemctl stop NetworkManager
macchanger -a wlan0
systemctl start NetworkManager
Take the script below and add your preferences
Copy and paste in a new text file, save it with some name (p.e. nmac);
make it executable (chmod +x nmac);
copy it in "/usr/bin" (cp nmac /usr/bin/nmac);
now you can simply use it from the superuser (su) console.
Don't use it for any illegal purpose, and use it at your own risk.
No comments:
Post a Comment