Can only ssh remotely with new hostname, not on local wifi

I just set up port forwarding (port 22) on my router (ip of 192.168.1.1). Now I can ssh into my server (ip of 192.168.1.7) remotely (from another internet connection) using its new static domain name I made with the www.noip.com service. However that new host name doesn't work when I'm on the local wifi of the server — when on local wifi, I can only ssh into it with ssh username@192.168.1.7 (as I could before I set up port forwarding). I wonder if a popup that appeared from the router before I clicked "submit" is relevant to not being able to ssh into the machine locally using the noip domain name. Screenshot from router is attached.
 

Attachments

  • Screen Shot 2016-10-20 at 2.34.03 pm.png
    Screen Shot 2016-10-20 at 2.34.03 pm.png
    192.5 KB · Views: 613
The error message is about conflicting ports, the router itself also has SSH listening on port 22. A redirection of port 22 would overrule this.

The 'problem' you're facing is because the NoIP service resolves to your external IP address. Any connections from inside the network will go out on the internet but needs to connect back in. This usually causes problems. This requires a so-called Hairpin NAT. Not all routers support this. With a "proper" domain you could set up split horizon DNS. What this basically does is resolve external requests to the external IP address and internal requests to the internal address.
 
It turns out all I had to do was login to my router and associate the ip 192.168.1.7 with my domainname. In the router, this was in a section under the "advanced settings", then "LAN domain". Now I can use the domainname locally.
 
Back
Top