New IP address does not persist after restart : <p>I have some code that uses system commands to set the IP address and default gateway in Linux.</p>

<p>It works, but when the Linux OS is restarted, it reverts back to the old IP address.</p>

<p>Here are the commands used, addresses changed here.</p>

<pre><code>  ip link set eth1 down
  ifconfig eth1 0.0.1.2 netmask 255.255.255.0
  route add default gw 0.0.1.2 eth1
  ip link set eth1 up
</code></pre>

<p>Is there another place in Linux where the IP address needs to be set, that 'ifconfig' does not change?</p>

<p>Thanks in advance for any replies.</p>
