Skip to content

Instantly share code, notes, and snippets.

@janeczku
Last active November 18, 2017 02:32
Show Gist options
  • Save janeczku/a23070f77144746a33dd to your computer and use it in GitHub Desktop.
Save janeczku/a23070f77144746a33dd to your computer and use it in GitHub Desktop.
OVH Public Cloud - Cloud-Init bootstrap Failover IP + Docker
#!/bin/sh
cat > /etc/network/interfaces.d/eth0-0.cfg <<EOF
auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
address 178.32.XXX.XXX
netmask 255.255.255.255
broadcast 178.32.XXX.XXX
post-up /sbin/ip route replace default via $(/sbin/ip route | awk '/default/ { print $3 }') dev eth0 src 178.32.XXX.XXX
EOF
ifdown eth0
ifup eth0
ifup eth0:0
wget -qO- https://get.docker.com/ | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment