Page 1 of 1

Problem with PHP $_SERVER["REMOTE_ADDR"]

Posted: Fri May 01, 2020 2:17 am
by javiersd
Hi guys
I have an openvpn server with public and static address 77.77.77.77, and a local client called 'julieta' running Centos with PHP and, 'julieta', has a full DMZ from the openvpn server; so when I put the main ip 77.77.77.77 everything goes to julieta no matter which port is. Works like a charm except from one thing.

When I use in julieta the PHP function $_SERVER["REMOTE_ADDR"] (this function gives the IP address from which the request was sent to the web server, in this case julieta), the function only returns the internal host of vpn server (in this case 172.27.224.1), not the real visitor ip.

So, looks like all my visitors come from te same address.

I try to change from NAT to Routing, but nothing change, what im missing?

I really aprecciate any help.
Javier

Re: Problem with PHP $_SERVER["REMOTE_ADDR"]

Posted: Fri May 01, 2020 12:41 pm
by TinCanTech
javiersd wrote:
Fri May 01, 2020 2:17 am
I try to change from NAT to Routing
Did you change or not ?

Re: Problem with PHP $_SERVER["REMOTE_ADDR"]

Posted: Fri May 01, 2020 1:01 pm
by javiersd
TinCanTech wrote:
Fri May 01, 2020 12:41 pm
javiersd wrote:
Fri May 01, 2020 2:17 am
I try to change from NAT to Routing
Did you change or not ?
Yes, I did, but nothing works.

Re: Problem with PHP $_SERVER["REMOTE_ADDR"]

Posted: Fri May 01, 2020 1:11 pm
by TinCanTech
So basically you don't know how to do routing ?

Re: Problem with PHP $_SERVER["REMOTE_ADDR"]

Posted: Fri May 01, 2020 1:52 pm
by javiersd
TinCanTech wrote:
Fri May 01, 2020 1:11 pm
So basically you don't know how to do routing ?
No, thats why im asking.

Re: Problem with PHP $_SERVER["REMOTE_ADDR"]

Posted: Fri May 01, 2020 6:50 pm
by TinCanTech
The howto explains this precisely.

Re: Problem with PHP $_SERVER["REMOTE_ADDR"]

Posted: Sun May 03, 2020 1:05 am
by javiersd
TinCanTech wrote:
Fri May 01, 2020 6:50 pm
The howto explains this precisely.
Thanks, but I can't find the solution... I'm newb

Can you tell me a little bit more?

Re: Problem with PHP $_SERVER["REMOTE_ADDR"]

Posted: Sun May 03, 2020 1:12 am
by TinCanTech
javiersd wrote:
Sun May 03, 2020 1:05 am
I'm newb
Hello newb

:geek: