Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- May 2006
Internal web server works from Internet, but not from internal network!
Here's the network layout:
user -> router -> Internet
router is a Fedora 4 machine running iptables and apache web server.
DNS (which is located on a separate network) has mydomain.com pointing at the network's external IP. I have no problems accessing the website (or mail) from any computer outside of this network.
However, when I try to access website from inside using mydomain.com, I can't. It just hangs. However, I can access the website using 192.168.0.1 IP just fine (which's the internal IP of the router).
Somebody told me that the problem is that when a request goes from the user, it tries to access the webserver via an external IP, but the response goes to an internal IP, which creates this problem. I don't really understand this, and if someone explained it would be nice.
Also, I was told that i need to add "192.168.0.1 mydomain.com" to router's /etc/hosts and restart it. Will this work? I want to be sure before I try it on a clien'ts machine.
Any help is appreciated, thanks!
Yes, the router doesn't let traffic from inside the lan go out then back in again. The solution is exactly as stated, add the internal ip address of the webserver to the /etc/hosts of all machines inside the lan that want to browse this web page.
If you get this wrong, dont worry - /etc/hosts is a text file, just make sure you copy the original out to someing else (say, /etc/hosts.orig) before you start, and you can always get back to where you were before you broke it (this is a standard sysadmin tip, btw, learn it well - it's saved my arse more than once.)Linux user #126863 - see http://linuxcounter.net/