Score:-2

Want to ssh from outside my LAN but get "no route to host"

do flag

I have Ubuntu 22.4.2 that I can ssh from my LAN, but not outside of it.

el@KOPPARTS4-PC:~$ ssh 192.168.1.93  
ssh: connect to host 192.168.1.93 port 22: No route to host  

I think I've forwarded the port correctly in my router, but when I ping or traceroute the server I get a response from a different address.

el@KOPPARTS4-PC:~$ sudo tcptraceroute 192.168.1.93  
[sudo] password for el:   
Running:   
traceroute -T -O info 192.168.1.93 
traceroute to 192.168.1.93 (192.168.1.93), 30 hops max, 60 byte packets  
1  KOPPARTS4-PC.mshome.net (172.18.96.1)  0.396 ms  0.379 ms  0.374 ms  
2  KOPPARTS4-PC (192.168.1.160)  1030.840 ms !H  3009.976 ms !H *
user4556274 avatar
ru flag
192.168.1.93 is an [rfc1918](https://datatracker.ietf.org/doc/html/rfc1918) address which is by definition only useful on a local LAN segment.
Bodo avatar
pt flag
`192.168.1.93` is a non-routeable address. Is this the internal IP address of the system in your LAN or the external IP address of your router? If it is the external IP address, then probably your provider uses carrier grade NAT which would not allow you to do what you want. Please [edit] your question to add requested information or clarifiction.
Score:2
pl flag

From inside your network use curl ifconfig.co/ to find out your public IP address. From outside, ssh to that address, not the private one.

wasabi deadwood avatar
do flag
Thanks, that did it. I've been scratching my head for a month trying to figure this out. I'm obviously new to Linux and learn something everyday. Thanks again for helping expand my knowledge.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.