• Resolved ac1643

    (@ac1643)


    Hi again,

    I mentioned this problem before and thought it had disappeared after restarting my computer. However its back!

    IP Geo Block: Once you logout, you will be unable to login again because your country code or IP address is not in the whitelist.Please check your Validation rule settings.

    I check the settings and get:

    Ip Address: 10.170.0.4 / ZZ (Cache)

    and since I only allow GB addresses I get the warning. My question is why am I getting this warning on some websites, but not others??

    Thanks

    https://www.ads-software.com/plugins/ip-geo-block/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi ac1643,

    As I told about this issue in email, I think your site might be within the LAN or behind the proxy server. Because the IP addresses from 10.0.0.0 to 10.255.255.255 are assigned as private IP address. Those should not be in the public.

    --------+-------------------- Internet
            | 90.200.*.*
          server
            | 10.170.*.*
        ----+--------------+----- Local Area Network
            |              |
        your computer    others

    https://en.wikipedia.org/wiki/IP_address#Private_addresses

    Your server’s IP address looks 90.200.*.* from the internet but it looks 10.170.*.* from the LAN.

    IGB uses PHP environment value $_SERVER['REMOTE_ADDR'] that your computer assigns. And it’s value might be 10.170.0.4. Definitely, IGB does not cause this issue, but it’s inevitable in your environment.

    To make the situation better than now,

    1. Uncheck all the “Geolocation API settings” but “Maxmind” and “IP2Location“.
    2. Put “ZZ” into “Whitelist of country code“.

    Or you can put the following snippet into your functions.php:

    function my_replace_ip( $ip ) {
        if ( false !== strpos( $_SERVER['REMOTE_ADDR'], '10.170.0' ) )
            return '90.200.xxx.yyy'; // your server's IP
        else
            return $_SERVER['REMOTE_ADDR'];
    }
    add_filter( 'ip-geo-block-ip-addr', 'my_replace_ip' );

    Good luck!

    Thread Starter ac1643

    (@ac1643)

    Thanks for this, I will do as you say and investigate the issue a bit further.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘IP address not correct on some websites using IP Geo Block.’ is closed to new replies.