Skip to content

Instantly share code, notes, and snippets.

@serverok
Created December 7, 2018 08:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save serverok/991f7ccd1be36cbc579e8d55caf39715 to your computer and use it in GitHub Desktop.
Save serverok/991f7ccd1be36cbc579e8d55caf39715 to your computer and use it in GitHub Desktop.
<?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