Ssh and http failed to connect with tailscale

Hi! I meet a strange problem. I can ping and use the Nomachine program(a remote desktop sharing program with NX protocol) with tailscale. However, I cannot use ssh or http server with tailscale.
I have 2 devices: 1 Windows laptop(Windows11 21H2) and 1 Linux desktop(Ubuntu 20.04.5). I can ping from my Windows to Ubuntu but I cannot use ssh or HTTP service(I run an Nginx server on my Ubuntu.)
The ping tailscale ping ubuntu result is like this:

pong from ubuntu (100.xx.xx.xx) via xx.xx.xx.xx:xxxxx in 70ms

Here’s the ssh command tailscale ssh username@ubuntu and the error be like:

Dial(“xxxx.tailaa36d.ts.net.”, 22): unexpected HTTP response: 502 Bad Gateway, dial failure: dial tcp 100.xx.xx.xx:22: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
kex_exchange_identification: Connection closed by remote host

I can directly use the sshd and nginx from Windows when under the same LAN, so these two services probably have no errors. I can use Nomachine from Windows to Ubuntu with tailscale, so the connection provided by tailscale is also usable. However, the connection from ssh or http always fails.
I’m a new tailscale user and I use the default tailscale settings. I wonder if I should change some of the tailscale settings. Besides, is it possible to check the full connection error logs for tailscale? Thanks.

Did you enable tailscale ssh?

Also check if your http server is bound to 0.0.0.0 and not to 127.0.0.1 or the LAN interface.

You can use netstat -tuplen to check this.

Thanks for your reply!
I’m not so familiar with tailscale and didn’t enable tailscale earlier. The ssh service works fine now. After checking the ip address of my http server, I found the main problem comes from the traffic from 100.xx.xx.xx to port 80 beings blocked by the firewall.
My problem is solved now and thanks for your help.

1 Like