Last active
November 18, 2017 02:32
-
-
Save janeczku/a23070f77144746a33dd to your computer and use it in GitHub Desktop.
OVH Public Cloud - Cloud-Init bootstrap Failover IP + Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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