ISPConfig and IPv6 in a mirror-setup 1


I use ISPConfig one some servers running in a mmirror-enviroment. Since IPv6 ist the way to use within the next years, i need a way to add a individual IPv6 for each vhost and this IP must be set, according to the subnet, on each mirror.

You can easily add a webdomain with a defined address within the interface. The ip will be written to the database.

I have for example the subnets Subnets 2a01:4f8:150:2262::/64 (Master-Server) and 2a01:4f8:120:1084::/64 (Mirror-Server).

Since the IP on the mirror is fetched from the database, only this ip will be written to each vhost. But the (mirror)server can´t of course listen to a foreign ip.

The solution is quite simple: if a vhost is written, the IPv6 must be changed so it fits the local subnet.

If i add a website with IPv6 2a01:4f8:150:2262::aaaa, the prefix (2a01:4f8:150:2262::) will be changed on the mirror with the own (2a01:4f8:150:2262::).

First we define the subnet in /usr/local/ispconfig/server/lib/config.inc.local.php:
<?php
$conf['ipv6_subnet']='2a01:4f8:150:2262::';
?>

And add a few lines to apache2_plugin.inc.php (just behind if($data['new']['ipv6_address'] != '') {
(in ISPConfig-3.0.4.6.tar.gz it´s line 1052)

if (isset($conf['ipv6_subnet']) && $conf['ipv6_subnet'] <> '') {
$explode_v6prefix=explode(':',$conf['ipv6_subnet']);
$explode_v6=explode(':',$data['new']['ipv6_address']);
for ( $i = 0; $i <= count($explode_v6prefix)-3; $i++ ) {
$explode_v6[$i] = $explode_v6prefix[$i];} $data['new']
['ipv6_address'] = implode(':',$explode_v6);
}


<?php
//** IP-handling
$conf['ipv6_subnet']='2a01:4f8:120:1084::';
?>


Leave a comment

Your email address will not be published. Required fields are marked *

One thought on “ISPConfig and IPv6 in a mirror-setup