Connecting to network device behind NAT from local LAN using the external port and IP
Posted
by
lumbric
on Super User
See other posts from Super User
or by lumbric
Published on 2012-07-04T20:06:15Z
Indexed on
2012/07/04
21:18 UTC
Read the original article
Hit count: 197
networking
|nat
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?
© Super User or respective owner