I'm having an odd LAN connection problem that i can't seem to track down. First the setup, somewhat simplified: Two computers, both connected through wifi to a router, which in turn is connected to the outside internet (IP address supplied by ISP, let's say 64.x.y.z, and an internal address of One of the computers, running Ubuntu 18.04 (computerA, is running an sshd server that i would like to connect to from the other (computerB, This computer could be a phone, a Windows laptop... The wireless router has incoming connections on port 22 from outside forwarded to computerA, the Ubuntu sshd server.

I cannot seem to ssh directly from computerB to computerA. I simply get a message:

Connecting to port 22

And nothing happens. Interestingly, netstat running on computerA shows a connection is attempted:

tcp        0      0     SYN_RECV

That just eventually times out, though.

On the other hand, if i ssh to the router's external IP address, 64.x.y.z from computerB, the connection is forwarded to computerA (as it should be) and the ssh session is immediately established.

Some additional information in case it's relevant: I can't ping the Ubuntu server from computerB, but traceroute does work:

#  traceroute
traceroute to (, 30 hops max, 46 byte packets
1 (  14.309 ms  3.068 ms  2.777 ms

From the Ubuntu server i CAN ping computerB, and traceroute similarly shows 1 hop. Physically, the route should pass through the wifi router, but its address ( doesn't show up. So i don't think the issue is with the router (I could be wrong... computerB is using the 5GHz link, computerA the 2.4GHz link. Though, when computerB was the Windows laptop, that was also on 2.4GHz).

Iptables on the Ubuntu server is completely empty.

Very, very rarely the ssh connection from computerB to computerA is established. I can't reproduce when this happens, though.

I suspect something on the Ubuntu server is (mis)configured to reject connections coming from the local network. I'm at a loss how to further diagnose this problem... Any suggestions would be greatly appreciated!

lsof -i shows that sshd is indeed listening:

 sshd 1316 root 3u IPv4 58798457 0t0 TCP *:ssh (LISTEN)
 sshd 1316 root 4u IPv6 58798461 0t0 TCP *:ssh (LISTEN)

Not sure what else i should be looking for... As i mentioned, connections from outside of my LAN work without an issue.

No firewall at all:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
  • first step: look at the output from sudo lsof -i on A. – guntbert Aug 22 '18 at 20:19
  • Please edit your question to provide additional information. Comments might get lost. – guntbert Aug 25 '18 at 10:50
  • Are you running a firewall on ComputerA, can you put the output of sudo iptables -L? – ob2 Aug 26 '18 at 20:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.