title: boot2docker / bootsync.sh ignores my default gateway?
body: <p>I'm trying to configure a static IP address for a docker machine.</p>
  
  <p>Thanks to <a href="https://stackoverflow.com/questions/34336218/is-there-a-way-to-force-docker-machine-to-create-vm-with-a-specific-ip#34336489">VonC answer</a>, I managed to get started.</p>
  
  <p>However, I'm facing a problem: boot2docker seems to ignore the "route add default gw 192.168.0.1", no matter what.</p>
  
  <p>To reproduce:</p>
  
  <h2>1. Create a new docker machine: OK</h2>
  
  <pre><code>docker-machine create -d hyperv --hyperv-virtual-switch "Primary Virtual Switch" Swarm-Worker1
  </code></pre>
  
  <h2>2. Apply your batch: OK</h2>
  
  <pre><code>dmvbf Swarm-Worker1 0 108
  </code></pre>
  
  <h2>3. SSH into the machine and check that bootsync.sh is fine: OK</h2>
  
  <pre><code>cat /var/lib/boot2docker/bootsync.sh
  
  output:
  kill $(more /var/run/udhcpc.eth0.pid)
  ifconfig eth0 192.168.0.108 netmask 255.255.255.0 broadcast 192.168.0.255 up
  route add default gw 192.168.0.1
  </code></pre>
  
  <h2>4. Exit SSH, restart the machine then regenerate certs: OK</h2>
  
  <pre><code>docker-machine restart Swarm-Worker1
  docker-machine regenerate-certs Swarm-Worker1
  </code></pre>
  
  <h2>5. Check that the IP matches the desired one: OK</h2>
  
  <pre><code>docker-machine env Swarm-Worker1
  </code></pre>
  
  <h2>6: SSH into the machine and check its routes: KO</h2>
  
  <pre><code>route -n
  
  output:
  127.0.0.1       0.0.0.0         255.255.255.255 UH    0      0        0 lo
  172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
  192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
  </code></pre>
  
  <h2>7: Try to set the gateway manually and check if it works: OK</h2>
  
  <pre><code>route add default gw 192.168.0.1
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>ip route add default via 192.168.0.1
  </code></pre>
  
  <p>Anyone knows what's happening? Why would boot2docker ignore only the route instruction? How can I solve that?</p>
  
  <p>P.S: My docker-machines run on Docker-Engine - Community 18.09.6</p>