title: configure ip alias and route, deal with network unavailable
body: <p>I need to write a script to set ip address/mask/broadcast as an alias on eth0:0 plus set the default gateway.</p>
  
  <p>This solution works:</p>
  
  <pre><code>ifconfig eth0:0 &lt;ip&gt; netmask &lt;mask&gt; up
  ip route replace default via &lt;ip&gt;
  </code></pre>
  
  <p>but sometimes the second call gets an error "network unavailable".</p>
  
  <p>Adding a sleep between them fixes it, but is unreliable. What is the proper way to wait for the network to be ready?</p>
  
  <p>The best I came up with so far is retrying the ip call a couple times. This works, but feels ugly. </p>