I have an home server running on ubuntu server and I want to connect to it with ssh via the external IP with my laptop in the same local network.
I want to do this:
In this case the gateway (my router) forwards external Port 22165
to 192.168.0.165
on Port 22
to communicate with the correct server:
When I want to connect with ssh on windows it times out:
C:\Users\andri> ssh -vvv user@46.x.x.x -p 22165
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug3: Failed to open file:C:/Users/andri/.ssh/config error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolve_canonicalize: hostname 46.x.x.x is address
debug2: ssh_connect_direct
debug1: Connecting to 46.x.x.x [46.x.x.x] port 22165.
debug3: finish_connect - ERROR: async io completed with error: 10060, io:000002148F1B4A00
debug1: connect to address 46.x.x.x port 22165: Connection timed out
ssh: connect to host 46.x.x.x port 22165: Connection timed out
I always connected to it via the external IP and it worked. I also hosted an nginx webserver on it and I think it doesn't work anymore since I stopped the nginx server. Can't tell what I did wrong, but maybe I changed something in some config files but I can't remember which one and I don't know how to find the problem.
My question: How to connect to my server, which is in the same network as my client, via the external/public IP address?
Other information
- On external network with external IP: Connection works
- On internal network with internal IP: Connection works
- Pinging
46.x.x.x
works