ISPConfig – 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-rc1

For some reason my v6-rewrite-code is a part of the current release candidate. It´s very nice but unfortunately some parts are missing in the interface. What is lacking in detail, i’ve to find out. So i describe how to use the basic rewrite without changes to the interface.
In /usr/local/ispconfig/server/plugins-available/ replace line 1294 – 1304 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 1270 (//* 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 *