I know there are several tutorials on how to manually change IP settings. However, I have yet to find a solution that fits my needs. I need to be able to script something that changes the IP address settings of a host machine. I have tried /sbin/ifconfig eth0 192.168.0.5 netmask 255.255.255.0; /sbin/route add default gw 192.168.0.1
.
This solution works until the machine is rebooted. I have tried running the scripted solution at @reboot by crontab from root. However, the settings do not take effect. I have noticed too that /etc/network/interfaces
settings do no change after making ifconfig
calls.
Is there a way to change IP address settings using ifconfig
so that the settings do not change on reboot?