• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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