ISPConfig rc2 – rewrite ip on mirror(s)

As i described here, i change on a mirror the ipv6 according to the relevant subnet in the vhost-files. I added a rewrite for IPv4 and show you how to use this with the current RC.

Use this only with ISPConfig-3.0.5-rc2
For ISPConfig-3.0.5-rc2 see my post here.

In /usr/local/ispconfig/server/plugins-available/ replace line 1333 – 1343 with:

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

The individual v6-subnet is added to /usr/local/ispconfig/server/lib/

That´s all for ipv6. No we can rewrite ipv4.

In add after line 1309 (//* Add vhost for ipv4 IP:

if (isset($conf['ipv4_replace']) && $conf['ipv4_replace'] <> "" && $data['new']['ip_address'] <> '*') {
$data['new']['ip_address'] = $conf['ipv4_replace'];

and in /usr/local/ispconfig/server/lib/ define the ipv4 for the server itself:

IPV4 will only be rewritten, if a local is defined and you didn´t set * in ISPConfig for the IP-Address.

Leave a comment

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