Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I noticed at several different LANs connected to the Internet through a NAT the following phenomena. There is a server in the LAN and there is a port forwarding to reach this server also from outside the LAN through the NAT. E.g. consider a LAN with the address 192.168.0.* and a SSH server at 192.168.0.2 with port 22 and a forwarding from port 2222 at the NAT 192.168.0.1 to 192.168.0.2:22. If the NAT's external IP is 44.33.22.11, one can connect to the SSH server through 44.33.22.11:2222. Surprisingly this works only from outside the LAN. If one tries to connect to 44.33.22.11:2222 from behind the NAT, there is no answer. Of course one could simply use 192.168.0.2:22, but often it is simpler to use the external IP. The typical use case for me is the configuration on a laptop computer. Usually the user uses any arbitrary Internet connection to connect to his home or office server, but sometimes he will use also the LAN to connect to it and it would be annoying to have to different configurations or bookmarks.

Why does it fail to connect from inside the LAN?

Is there any good work around?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The feature you are looking for is officially (according to the IETF, the internet standards body) called "NAT hairpinning", although it also gets called other things, such as "NAT reflection".

Good home gateways support it. Crappy ones don't. If you have a crappy one, either replace it with a good one, or see if you can get a third-party open source aftermarket home gateway firmware distro such as DD-WRT to run on it. (Hmm, I've never actually tested hairpinning with DD-WRT, but it has such a good reputation I would hope this is one of the things it does. )

share|improve this answer
    
Thanks for your enlightening answer. Unfortunately this sounds like no good news for me. At home I am running a DD-WRT router, but behind the ISP's modem/router. Neither at the office I can replace the ISP's modem/router. A good work-a-round would be nice... –  lumbric Jul 5 '12 at 18:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.