Skip to content

Instantly share code, notes, and snippets.

@GHF2014
Last active January 5, 2020 09:35
Show Gist options
  • Save GHF2014/5439d41bacae1f6de6de1fcf38ece00f to your computer and use it in GitHub Desktop.
Save GHF2014/5439d41bacae1f6de6de1fcf38ece00f to your computer and use it in GitHub Desktop.
OVH failover IP config for Ubuntu/Debian
<?php
$ipList = "
192.99.182.41
158.69.56.235
158.69.101.3
158.69.56.236
167.114.11.211
158.69.57.190
192.99.182.223
192.99.182.192
192.99.182.193
192.99.182.195
192.99.182.142
192.99.182.238
158.69.101.41
192.99.182.194
158.69.101.58
158.69.115.179
";
$ips = explode("\n", $ipList);
$interfaceAlias = 0;
foreach ($ips as $ip) {
$ip = trim($ip);
if (empty($ip)) continue;
echo "
auto ens3:$interfaceAlias
iface ens3:$interfaceAlias inet static
address $ip
netmask 255.255.255.255
broadcast $ip
";
$interfaceAlias ++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment