Page 1 of 1

Client IP address incorrect, reverts to server IP

Posted: Fri May 25, 2018 6:24 pm
by 5chn3ll
I've found a lot of traffic around this topic, but not the magic bullet so far.

I'm running phpBB on a GoDaddy server. The install works perfectly except one issue: the client IP address is always wrong. Clients always show an IP address in the GoDaddy IP range instead of the actual IP address.

When I echo back HTTP_X_FORWARDED_FOR, the results include my correct IP address, but the address is prepended with :ffff:. Presumably it's the :ffff: that prevents the address from parsing correctly.

To see this in action, visit 996outpost.com/ipcheck.php. The PHP echoes three values: SERVER_ADDR, REMOTE_ADDR, and HTTP_X_FORWADED_FOR.

REMOTE_ADDR is always incorrect; it's always the same value as SERVER_ADDR.

Is there a solution to this? None of the user verification extensions will work properly since each visitor's IP is erroneously indicated as the server IP.

I have found a couple of threads, one suggesting changes to startup.php and another with a line added to session.php, but neither helped out.

Thanks in advance for pointing me in the right direction.

Re: Client IP address incorrect, reverts to server IP

Posted: Fri May 25, 2018 6:25 pm
by Lumpy Burgertushie
try turning off cloudfare in your hosting control panel and see what happens.

robert

Re: Client IP address incorrect, reverts to server IP

Posted: Fri May 25, 2018 6:31 pm
by 5chn3ll
I can't find this setting anywhere - I'd seen a similar post, but I can't find anything related to site acceleration...

Re: Client IP address incorrect, reverts to server IP

Posted: Fri May 25, 2018 6:38 pm
by 5chn3ll
Per GoDaddy's documentation, website acceleration is no longer offered to new accounts.

Re: Client IP address incorrect, reverts to server IP

Posted: Sat May 26, 2018 5:16 am
by thecoalman
The IP address being reported by the script is not a Cloudflare IP so that is not the issue, it's one reserved for internal networks. This is misconfigured server or something else that needs to be resolved by Godaddy support.

Re: Client IP address incorrect, reverts to server IP

Posted: Sat May 26, 2018 2:49 pm
by 3Di
I see you are running Apache, try this inside your script:

Code: Select all

if (function_exists('apache_request_headers'))
{
	$headers = apache_request_headers();
	$real_client_ip = $headers["X-Forwarded-For"];
	echo 'Real client IP: ' . $real_client_ip;
}
else
{
	echo 'Unable to find the function apache_request_headers';
}
Just written but tested..

Re: Client IP address incorrect, reverts to server IP

Posted: Sat May 26, 2018 3:00 pm
by stevemaury
It's a feature, not a bug. Now you are more GDPR compliant.

Re: Client IP address incorrect, reverts to server IP

Posted: Sun May 27, 2018 4:57 am
by 3Di
stevemaury wrote:
Sat May 26, 2018 3:00 pm
It's a feature, not a bug. Now you are more GDPR compliant.
The point is
5chn3ll wrote:
Fri May 25, 2018 6:24 pm
None of the user verification extensions will work properly since each visitor's IP is erroneously indicated as the server IP.
Which IMO deserves to get a little help if possible, that's what I am trying to do here.

Re: Client IP address incorrect, reverts to server IP

Posted: Sun May 27, 2018 7:57 am
by Mick
What have godaddy got to say about it?