Problem with PHP $_SERVER["REMOTE_ADDR"]

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
javiersd
OpenVpn Newbie
Posts: 4
Joined: Fri May 01, 2020 1:50 am

Problem with PHP $_SERVER["REMOTE_ADDR"]

Post by javiersd » Fri May 01, 2020 2:17 am

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

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » 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 ?

javiersd
OpenVpn Newbie
Posts: 4
Joined: Fri May 01, 2020 1:50 am

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

Post by javiersd » Fri May 01, 2020 1:01 pm

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.

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » Fri May 01, 2020 1:11 pm

So basically you don't know how to do routing ?

javiersd
OpenVpn Newbie
Posts: 4
Joined: Fri May 01, 2020 1:50 am

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

Post by javiersd » Fri May 01, 2020 1:52 pm

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

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » Fri May 01, 2020 6:50 pm

The howto explains this precisely.

javiersd
OpenVpn Newbie
Posts: 4
Joined: Fri May 01, 2020 1:50 am

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

Post by javiersd » Sun May 03, 2020 1:05 am

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?

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » Sun May 03, 2020 1:12 am

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

:geek:

Post Reply