Hi all,
I'm using OpenWrt 15.05 on a TP Link router behind a cable modem set to bridge mode. Everything is working smoothly, however there's one minor annoyance.
In a PHP script on a local web server (192.168.1.10) the variable $_SERVER['REMOTE_ADDR'] does not equal the ip address of the client (e.g. 192.168.1.200) but instead is set to 192.168.1.1 (the ip address of the OpenWrt router/gateway) if I'm accessing the web server by its public domain (port forwarding from WAN to 192.168.1.10) from my local network.
As example:
http://dev.example.com/script.php -> incorrectly yields 192.168.1.1 as REMOTE_ADDR
http://192.168.1.10/script.php -> correctly yields 192.168.1.200 as REMOTE_ADDR
If I set a static hosts entry in Windows for dev.example.com:
http://dev.example.com/script.php -> correctly yields 192.168.1.200 as REMOTE_ADDR
What am I missing? The old and simple provider based router did that "right" or rather as expected. Is it a basic networking misunderstanding on my side? Is it a solvable problem in the OpenWrt config?
The router config is pretty much untouched and standard by the way.
Thanks in advance!
(Last edited by therealone on 19 Apr 2016, 11:22)