• Resolved sabine99uber

    (@sabine99uber)


    For some reason I was able to block a IPv4 but I am not even able to block a single IPv6 adress.

    For example, I wanted to block:

    2a02:3037:609:7f89:f52c:a8d2:77fe:4bba

    here is a screenshot:

    It does not have any effect. In the debug.log it says:

    {"time":"2023-07-31 21:21:48","client_ip":"2a02:3037:609:7f89:f52c:a8d2:77fe:4bba","country":"DE","is_proxy":"NO","proxy_type":"-","lookup_by":"??","cache":true,"uri":"https:\/\/www.my-website.de (https://www.my-website.de/)\/?bundesland=bundesland_D%C3%A4nemark","message":"Access is allowed.","action":"ABORTED"}
    • This topic was modified 1 year, 4 months ago by sabine99uber.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ip2location

    (@ip2location)

    Please upgrade to version 2.32.1 for better IPv6 matching.

    Thread Starter sabine99uber

    (@sabine99uber)

    I now tried it with the newest version of the plugin but it still does not work.

    This is the IP range with the exact notation I wanted to block:

    “2a02:3037:60e:8982:51c0:8497:a9e:8222/48”

    And this is the entry from the debug.log:

    {"time":"2023-08-05 18:27:12","client_ip":"2a02:3037:60e:8982:51c0:8497:a9e:8222","country":"DE","is_proxy":"NO","proxy_type":"-","lookup_by":"??","cache":true,"uri":"https:\/\/www.my-website.de\/","message":"Access is allowed.","action":"ABORTED"}

    Furthermore the error.log of my server is full of these entries:

    [Sat Aug 05 20:32:18 2023] [php:error] [pid 11272] [client 93.234.99.99] [host www.my-website.de] PHP Fatal error:  Uncaught ArithmeticError: Bit shift by negative number in /is/htdocs/wp999_M6844J1999/www/wp-content/plugins/ip2location-country-blocker/ip2location-country-blocker.php:3715\nStack trace:\n#0 /is/htdocs/wp999_M6844J999/www/wp-content/plugins/ip2location-country-blocker/ip2location-country-blocker.php(3527): IP2LocationCountryBlocker-]cidr_match(1575628851, '2a02:3037:60e:8...')\n#1 /is/htdocs/wp13911663_M6844J1999/www/wp-content/plugins/ip2location-country-blocker/ip2location-country-blocker.php(2136): IP2LocationCountryBlocker-]is_in_list('93.234.99.99', 'frontend_ip_bla...')\n#2 /is/htdocs/wp999_M6844J1999/www/wp-includes/class-wp-hook.php(308): IP2LocationCountryBlocker-]check_block('')\n#3 /is/htdocs/wp999_M6844J1999/www/wp-includes/class-wp-hook.php(332): WP_Hook-]apply_filters(NULL, Array)\n#4 /is/htdocs/wp13911999_M6844J1999/www/wp-includes/plugin.php(517): WP_Hook-]do_action(Array)\n#5 /is/htdocs/wp13911999_M6844J1999/www/wp-settings.php(623): do_action('init')\n#6 /is/htdocs/wp999_M6844J1999/www/wp-config.php(122): require_once('/is/htdocs/wp99...')\n#7 /is/htdocs/wp999_M6844J1999/www/wp-load.php(50): require_once('/is/htdocs/wp99...')\n#8 /is/htdocs/wp999_M6844J1999/www/wp-blog-header.php(13): require_once('/is/htdocs/wp99...')\n#9 /is/htdocs/wp999_M6844J1999/www/index.php(17): require('/is/htdocs/wp13...')\n#10 {main}\n  thrown in /is/htdocs/wp999_M6844J1999/www/wp-content/plugins/ip2location-country-blocker/ip2location-country-blocker.php on line 3715

    (I needed to replace some numbers in the last log for data protection)

    This time it seemed to work when I wanted to block a single IPv6 adress but the range is not working.

    • This reply was modified 1 year, 3 months ago by sabine99uber.
    Thread Starter sabine99uber

    (@sabine99uber)

    Update: When I try to debug it, the problem really seems to come from the following line

    “$mask = -1 << (32 – $bits);”

    In the

    “cidr_match($ip, $range)”

    function.

    I removed all IPv6 adresses for now because some of my users reported me that the website is crashing and sent me the following screenshot:

    • This reply was modified 1 year, 3 months ago by sabine99uber.
    • This reply was modified 1 year, 3 months ago by sabine99uber.
    • This reply was modified 1 year, 3 months ago by sabine99uber.
    Plugin Author ip2location

    (@ip2location)

    Please send us the IPv6 CIDR in your list to support[at]ip2location[dot]com for investigation.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot block IPv6 adresses’ is closed to new replies.