• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Adding a whole range instead of individual IPv6 addresses

Ross_Fisher

New Pleskian
Greetings!

My provider provides a /64 block of IPv6 addresses to use. In cPanel, I could simply dump in the range and mass automagically enable a unique IPv6 address for each domain/account.

I have IPv6 addresses 2001:19f0:4009:4204:0000:0000:0000:0000-
2001:19f0:4009:4204:ffff:ffff:ffff:ffff

How do I add a range into Plesk and have it assign an IPv6 per account/domain?
 
Hi Ross_Fisher,

due to the case that there is no "automatic" assignment - feature, you might find it interesting to read this external article:

http://www.ispcolohost.com/2013/07/11/create-ipv6-addresses-based-on-ipv4-on-a-plesk-server/ ( External link, ples. inform me if the link goes dead! )

The author provided a self-made-script ( usage on your very own risk! ), which you could modify to fit your needs:

Code:
# Define IPv6 /32 as "####:####"
$ipv6Assignment = "2001:db8";
# Define site ID as just an integer
$ipv6SiteID = "1";
# Define VLAN of server
$vlan = "500";
# Define primary network interface name; typically eth0 or em1
$iface = "eth0";
# Define IPv6 subnet mask; should very rarely be anything other than /64
$mask = "64";
@ipList = `/usr/local/psa/bin/ipmanage --ip_list`;
foreach $line (@ipList) {
chomp $line;
if ( $line =~ /^0     E    $iface:(\d+)\.(\d+)\.(\d+)\.(\d+)\// ) {
  $ipv6 = sprintf("$ipv6Assignment:$ipv6SiteID:$vlan:%X:%X:%X:%X",$1,$2,$3,$4);
  $ipv4 = "$1.$2.$3.$4";
  #
  # Doesn't matter of the IPv6 address already exists
  # because Plesk will just give an error about adding it.
  #
  print "/usr/local/psa/bin/ipmanage -c $ipv6 -type exclusive -mask $mask -interface $iface\n";
}
}
 
Last edited by a moderator:
Back
Top