You are not logged in.
Pages: 1
Hello everyone!
I have an old laptop that is running Ubuntu Server 22.04.1 LTS. I am trying to ssh from a different network but I get an error message saying ssh: connect to host <server's public ip> port 22: No route to host
I have assigned a static IP to the server and enabled port forwarding on my router. The ssh does work from the local network.
Things I tried but didn't work
1. I tried changing the listening port to something other than 22 on the router in case it was blocked by ISP.
2. ping <public IP of router>.
ufw status on server
To Action From
-- ------ ----
22/tcp ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)Last edited by an4rki_ (2022-09-30 15:08:20)
"A computer is like air conditioning - it becomes useless when you open Windows." - Linus Torvalds
Arch + DWM
Offline
I get an error message saying ssh: connect to host <server's public ip> port 22: No route to host
What you mean with <server's public ip>?
In case connecting over internet it should be equal to <public IP of router>
In case of connecting from other network in your local network proper routing should be set.
Things I tried but didn't work
2. ping <public IP of router>.
Do you have enabled ping from WAN on your router?
Offline
Hey thanks for the quick reply GeorgeJP.
What you mean with <server's public ip>?
Yes, I meant the router's public IP, sorry if that confused you.
Do you have enabled ping from WAN on your router?
I haven't enabled anything on the router apart from port forwarding port 22.
"A computer is like air conditioning - it becomes useless when you open Windows." - Linus Torvalds
Arch + DWM
Offline
It seems my router is behind a CGNAT (the address is 100.x.x.x). Which means no publicly routable address address for my server? I came across this. Which will indeed solve my ssh problem, but I won't be able to do something like host a public website on the server right?
"A computer is like air conditioning - it becomes useless when you open Windows." - Linus Torvalds
Arch + DWM
Offline
Hello everyone!
I have an old laptop that is running Ubuntu Server 22.04.1 LTS. I am trying to ssh from a different network but I get an error message saying ssh: connect to host <server's public ip> port 22: No route to host
I have assigned a static IP to the server and enabled port forwarding on my router. The ssh does work from the local network.
Things I tried but didn't work
1. I tried changing the listening port to something other than 22 on the router in case it was blocked by ISP.
2. ping <public IP of router>.ufw status on server
To Action From -- ------ ---- 22/tcp ALLOW Anywhere 22/tcp (v6) ALLOW Anywhere (v6)
Often these kinds of errors a done by rebooting the hosts!
Offline
an4rki_ wrote:Hello everyone!
I have an old laptop that is running Ubuntu Server 22.04.1 LTS. I am trying to ssh from a different network but I get an error message saying ssh: connect to host <server's public ip> port 22: No route to host
I have assigned a static IP to the server and enabled port forwarding on my router. The ssh does work from the local network.
Things I tried but didn't work
1. I tried changing the listening port to something other than 22 on the router in case it was blocked by ISP.
2. ping <public IP of router>.ufw status on server
To Action From -- ------ ---- 22/tcp ALLOW Anywhere 22/tcp (v6) ALLOW Anywhere (v6)Often these kinds of errors a done by rebooting the hosts!
Hey kinghol, I tried rebooting the server and router but that did not solve the issue.
"A computer is like air conditioning - it becomes useless when you open Windows." - Linus Torvalds
Arch + DWM
Offline
Are you sure, that you have public static IP from your provider?
Temporary enable ping from WAN on your router (just to verify, that there is connection).
Try other port (8080 for example) and forward it: <public IP>:8080 to <local IP>:22
Offline
Are you sure, that you have public static IP from your provider?
The connection type is set to PPPoE in WAN Settings
"A computer is like air conditioning - it becomes useless when you open Windows." - Linus Torvalds
Arch + DWM
Offline
The connection type is set to PPPoE in WAN Settings
If your WAN IP is like 192.168.x.x, 172.16.x.x or 10.x.x.x, then you don't have public IP.
You must check it on router.
Type of connection depends on contract with ISP. Public static IP is often charged by more money.
Offline
If your WAN IP is like 192.168.x.x, 172.16.x.x or 10.x.x.x, then you don't have public IP.
Running curl ifconfig.me gives me 111.125.x.x as output in the terminal, which is my router's public IP address.
But in the WAN Settings page shows that it is using a WAN address:100.x.x.x which is in the CGNAT IP range. Which means that my ISP is NATing multiple such public addresses (100.x.x.x). Correct me if I am wrong.
"A computer is like air conditioning - it becomes useless when you open Windows." - Linus Torvalds
Arch + DWM
Offline
In this case you are not able reach your network from internet.
Try contact your ISP if he offers also public static IP.
Offline
In this case you are not able reach your network from internet.
Try contact your ISP if he offers also public static IP.
Nah, static IP addresses are not very affordable. Tailscale seems like a decent solution for this at the moment. Appreciate the help though.
Last edited by an4rki_ (2022-09-28 12:41:32)
"A computer is like air conditioning - it becomes useless when you open Windows." - Linus Torvalds
Arch + DWM
Offline
If one side can be reached reliably on a public IP, you can set up Wireguard directly... otherwise if both sides are behind dynamic IP / NAT / firewalled, you need an external helper to open up a connection between the two parties. This could be your own VPS or a system like tailscale, they made a large blog post on the nat issue https://tailscale.com/blog/how-nat-traversal-works/ - however if their server goes down, so does your network next time it needs to reconnect.
You can also try your luck with IPv6 if you have that available. It depends on your ISP, whether they support that and allow direct connections, when its not possible for shared IPv4.
Offline
Pages: 1