Since IPS seems to lack the willingness to fix the IPv6 issue with their software, and given the amount of users willing to totally disable IP protection on their board to allow IPv6 users, I decided to provide with those people an alternative solution allowing to differenciate users.
This will create fake IPv4 for IPv6 users based on the 64 first bits of their IP. As most currently exising IPv6 providers are assigning /64 classes to their customers, banning the generated IPv4 effectively bans the whole IPv6.
Also I do generate a 32bits IPv4 from 64bits of IPv6 using XOR. While this means people using IPv6 might share the same generated IPv4 (quite unlikely), it is usually impossible for someone to obtain a different generated IPv4 without access to more than a /64 (I believe only system administrators have this kind of thing).
You might want to store in database generated IPv4 and their IPv6 counterparts to be able to recover a given IPv6 from a blocked IPv4.
This method also allows to block IPs in the same subnet from IPv4 subnets (I don’t know if IPB supports this feature) and recognize people from the same subnet as the start of their generated ip will be the same (however whois information for the given IP will not match the real user’s ip).
To have the generated IPv4, insert this in conf_global.php :
$encoded_ip = inet_pton($_SERVER['REMOTE_ADDR']);
if (strlen($encoded_ip) == 16) {
$ipv4 = '';
for($i = 0; $i < 8; $i += 2) $ipv4 .= chr(ord($encoded_ip[$i]) ^ ord($encoded_ip[$i+1]));
$_SERVER['REMOTE_ADDR'] = inet_ntop($ipv4);
}
And remember to ask your IPB support to have real IPv6 ASAP.


