Skip to content

Instantly share code, notes, and snippets.

@iklobato
Last active February 13, 2020 00:32
Show Gist options
  • Save iklobato/d5d0220971f8ec0af55c9a25a693e0fa to your computer and use it in GitHub Desktop.
Save iklobato/d5d0220971f8ec0af55c9a25a693e0fa to your computer and use it in GitHub Desktop.
Request new local ip and mac addr
#!/bin/bash
sudo -s
service network-manager stop && service networking stop
for i in $(netstat -i | awk '{if (NR!=1 && NR!=2) print $1}'; do
ifconfig $i down;
macchanger -a $i;
dhclient -v -r $i
done
for i in $(netstat -i | awk '{if (NR!=1 && NR!=2) print $1}'; do
ifconfig $i up;
done
service network-manager start && service networking start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment