What is a good Linux script for changing an IP address statically in Ubuntu?
I have a shell script that currently changes the mac address of eth0 repeatedly. However, it does not change the public IP address, confirmed by wget -qO- ipinfo.io/ip.
while [ 1 ]
echo "Changing mac address..."
let lastup=`date +%s`
macchanger -A eth0
let diff=`date +%s`-$lastup
if [ "$diff" -lt "$PERIOD" ]
echo "Changed mac address successfully."
elif [ "$diff" -gt "$PERIOD" ]
echo "Command took longer than iteration period of $PERIOD seconds!"
The script needs to change the IP Address statically.
Also, ultimately, what I am trying to accomplish, for security reasons, is to frequently and automatically change a computer's public IP address and mac address. This way, my office's computers, when using the Internet, has an additional form of protection.