SSH: can't login from TrueNAS to one host

listhor

Contributor
Joined
Mar 2, 2020
Messages
133
I can't find the root cause why I can't login
Code:
root@freenas[~]# ssh root@172.16.0.20
ssh: connect to host 172.16.0.20 port 22: Operation timed out

via ssh from TrueNAS (172.16.0.9) to other host (172.16.0.20) while having following routes:
Code:
Routing tables
Internet:
Destination        Gateway            Flags     Netif Expire
default            172.16.1.1         UGS      vlan11
10.55.0.0/16       link#1             U          vmx0
10.55.1.2          link#1             UHS         lo0
127.0.0.1          link#5             UH          lo0
172.16.0.0/24      link#12            U         vlan1
172.16.0.9         link#12            UHS         lo0
172.16.1.0/26      link#8             U        vlan11
172.16.1.2         link#8             UHS         lo0
172.16.1.62        link#8             UHS         lo0
172.16.3.0/28      link#10            U        vlan13
172.16.3.14        link#10            UHS         lo0
172.16.4.0/26      link#11            U        vlan14
172.16.4.62        link#11            UHS         lo0
172.16.10.0/24     link#2             U          vmx1
172.16.10.9        link#2             UHS         lo0

In the same time I was able to ping that host:
Code:
root@freenas[~]# ping 172.16.0.20
PING 172.16.0.20 (172.16.0.20): 56 data bytes
64 bytes from 172.16.0.20: icmp_seq=0 ttl=63 time=0.534 ms
64 bytes from 172.16.0.20: icmp_seq=1 ttl=63 time=0.419 ms
64 bytes from 172.16.0.20: icmp_seq=2 ttl=63 time=0.335 ms
64 bytes from 172.16.0.20: icmp_seq=3 ttl=63 time=0.377 ms
64 bytes from 172.16.0.20: icmp_seq=4 ttl=63 time=0.543 ms
64 bytes from 172.16.0.20: icmp_seq=5 ttl=63 time=1.175 ms
^C
--- 172.16.0.20 ping statistics ---
6 packets transmitted, 6 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.335/0.564/1.175/0.284 ms

and login from TrueNAS to another host in the same subnet: 172.16.0.8

And after adding route to that particular host (172.16.0.20)
Code:
Routing tables
Internet:
Destination        Gateway            Flags     Netif Expire
default            172.16.1.1         UGS      vlan11
10.55.0.0/16       link#1             U          vmx0
10.55.1.2          link#1             UHS         lo0
127.0.0.1          lo0                UHS         lo0
172.16.0.0/24      link#12            U         vlan1
172.16.0.9         link#12            UHS         lo0
172.16.0.20/32     172.16.0.1         UGS       vlan1
172.16.1.0/26      link#8             U        vlan11
172.16.1.2         link#8             UHS         lo0
172.16.1.62        link#8             UHS         lo0
172.16.3.0/28      link#10            U        vlan13
172.16.3.14        link#10            UHS         lo0
172.16.4.0/26      link#11            U        vlan14
172.16.4.62        link#11            UHS         lo0
172.16.10.0/24     link#2             U          vmx1
172.16.10.9        link#2             UHS         lo0

All of sudden communication has been restored. WTF, default gateway or what else???
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Does the other host have the same default gateway, and a corresponding 172.16.0.0/24 route on VLAN 1?
 

listhor

Contributor
Joined
Mar 2, 2020
Messages
133
Other host (172.16.0.8) has default gateway in that subnet - 172.16.0.1
When logging in via ssh from laptop (being in 172.16.4.0 subnet) to any host: 172.16.0.8, 172.16.0.20 and TrueNAS 172.16.0.9 I had no problems at all. Only from TrueNAS to 172.16.0.20...
It must be something with default gateway on TrueNAS but what I can't understand is there was no problem with pinging and only with ssh (and there are no firewalls on both hosts).
 
Top