So I'm so lost on what to do to debug right now. I've spent a couple of weeks on this issue without understanding what is happening.
I'm trying to have the ssh server to only work with connections from the admin subnet but this shouldn't stop routed traffic from any subnet to the admin subnet.
So here is the setup. I have a VM under debian 9. This VM has two interfaces, eth0 in on the user subnet and eth1 is on the admin subnet. Both subnets have a DHCP/DNS server which is pfsense. Hostnames are automatically added to the DNS.
My sshd config file is the default on, with root login disabled and
ListenAddress set to eth1 IP.
So far this is the behavior that I have seen:
Both interface up,
- ssh from the user network through the pfsense router: connection established, can act for a short amount of time then the terminal freezes and times out. On wireshark I have some TCP retransmissions at this time
- ssh from the admin network directly: Everything works
- ssh from a computer with both network: Everything works
- ssh from a 3rd network (with rule to forbid access to the user network): Everything works
Both interfaces up,
ListenAddress disabled :
- Everything works, but of course ssh is available through the user network interface
Interface eth0 down,
- Everything works
There isn't any firewall on the server on purpose. I use the IP address to ssh and not the hostname, but both have the same result no matter if both interfaces have the same or a different hostname.
I really don't know where the issue is coming from. For me it can't be the pfsense because right now it simply allows all network traffic from the user network to go to the admin network. But maybe i'm wrong. And no error in the sshd logs either.