1

Is this a router issue?

I have a TP-LINK TD-W8960N wireless router. Today I set up an apache2 webserver on an ubuntu 12.04 machine in my house. I got my router to port forward TCP packets on port 8041 to the ubuntu machine port 8041, I got apache listening on port 8041, I gave the IP address of the router a domain name, let's say "example.com", and I expected everything to work fine.

But it doesn't quite work fine. If I go to http://example.com:8041 from a computer not in my intranet, it works fine. From within my intranet I can also access the webserver using http://192.168.1.25:8041, with 192.168.1.25 the local IP address which my router has given the ubuntu webserver.

However, if I go to http://example.com:8041 from a computer within my intranet, it doesn't work: I get an "unable to connect" error :-/

I tried moving everything to port 80. Port 80 is the port my router uses, so I changed the router's port to 8080 and ran apache through port 80 everywhere. This time it worked from outside the intranet, and with the intranet http://192.168.1.25 worked fine, but http://example.com took me to the router login page, even though the router was claiming to be listening on port 8080 :-/

Googling took me to this -- that person seems to have exactly the problem I had, but got no answers (but perhaps he posted it in the wrong place).

Is this the router's doing? I'd really like to be able to access the web pages locally using the correct external address (so I can write scripts which will work on machines in my intranet and also outside it; currently I have no one option which works on every computer I have access to, including those at my work which are not in my intranet).

1

1 Answer 1

1

Your router is failing to do hairpin NAT, a.k.a. "loopback NAT", etc.

The solution is usually to buy a better router, or to try to make your router better with a third-party aftermarket embedded Linux firmware distro like DD-WRT.

Apple's been pretty good at always making their AirPort base station firmware always support hairpin NAT. I don't have the experience to say the same for any other brand.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .