Problem with PHP $_SERVER["REMOTE_ADDR"]
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVpn Newbie
- Posts: 4
- Joined: Fri May 01, 2020 1:50 am
Problem with PHP $_SERVER["REMOTE_ADDR"]
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
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
-
- OpenVPN Protagonist
- Posts: 11139
- Joined: Fri Jun 03, 2016 1:17 pm
-
- OpenVpn Newbie
- Posts: 4
- Joined: Fri May 01, 2020 1:50 am
Re: Problem with PHP $_SERVER["REMOTE_ADDR"]
Yes, I did, but nothing works.
-
- OpenVPN Protagonist
- Posts: 11139
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Problem with PHP $_SERVER["REMOTE_ADDR"]
So basically you don't know how to do routing ?
-
- OpenVpn Newbie
- Posts: 4
- Joined: Fri May 01, 2020 1:50 am
Re: Problem with PHP $_SERVER["REMOTE_ADDR"]
No, thats why im asking.
-
- OpenVPN Protagonist
- Posts: 11139
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Problem with PHP $_SERVER["REMOTE_ADDR"]
The howto explains this precisely.
-
- OpenVpn Newbie
- Posts: 4
- Joined: Fri May 01, 2020 1:50 am
Re: Problem with PHP $_SERVER["REMOTE_ADDR"]
Thanks, but I can't find the solution... I'm newb
Can you tell me a little bit more?
-
- OpenVPN Protagonist
- Posts: 11139
- Joined: Fri Jun 03, 2016 1:17 pm