Results 1 to 3 of 3

Thread: Updated Guide: How to make random MAC address at each boot

  1. #1

    Updated Guide: How to make random MAC address at each boot

    Hi Guys,

    Here is my method to make your MAC address random with each reboot

    1. Open terminal and navigate to Desktop:
    cd Desktop

    2. Use command to create new text file:

    3. Edit it in gedit or leafpad and add the following text:

    ifconfig wlan0 down
    macchanger -r wlan0
    ifconfig wlan0 up
    service network-manager restart

    4. Save the file and call it (or whatever you choose)

    5. Change permissions on it to make it executable:
    chmod +a

    6. in the terminal, navigate to /root/.config/

    7. Add directory called auto start like this:
    mkdir autostart

    8. Now you should have path:

    9. Now in terminal, type:
    leafpad /root/.config/autostart/myscript.desktop

    10. Paste the following:

    [Desktop Entry]
    GenericName=A descriptive name
    Comment=Some description about your script

    11. Now save file and test it by rebooting, issue the reboot command

    12. Check ifconfig and verify the mac has changed!

    For some reason, this only works for me if the file is my desktop, I don't know why.

    I am not sure how working with network manager will effect this if you are using the drop downs, but for boot, it randomizes my MAC everytime


  2. #2
    Join Date
    To bluedangerforyou

    This approach has been seen before and will only work as long as Network Manager(NM) does not attempt to connect to a network. If NM attempts to connect to a network thru the device, the mac address will either revert to the device mac or will be changed to the cloned mac address in the NM drop-down menu. MTeams suggest you read thru:

    The above thread will give you a general overview and one approach to keep your spoofed mac address constant.

    Next read

    Pay particular attention to comments by hon3yb33 and especially the entries into the NM configuration file required to keep NM from affecting mac addresses made by macchanger.

    Musket Teams
    Last edited by mmusket33; 2017-05-09 at 10:31.

  3. #3
    Join Date
    Use crontab do crontab -e and if you have VI press I on your keyboard and you should be able to edit the file and go all the way on the bottom and type this @reboot macchanger -r wlan0 if you are using nano same thing go all the way to the bottom and type the exact same command then ctrl o and ctrl x and then reboot

Similar Threads

  1. Kali assigns random mac address to wlan0
    By trojan_cow in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2017-06-15, 18:44
  2. How to make mac address random at each boot up
    By Defaultzero in forum How-To Archive
    Replies: 19
    Last Post: 2016-12-16, 13:22
  3. Replies: 2
    Last Post: 2016-10-09, 06:12
  4. Replies: 0
    Last Post: 2014-02-10, 17:53

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts