Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.