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



## molofishy (Oct 20, 2016)

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.


----------



## SirDice (Oct 20, 2016)

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.


----------



## molofishy (Nov 7, 2016)

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.


----------



## freebuser (Nov 7, 2016)

hairpin NAT


----------

