Consistent SSH Disconnection and Reconnection Issue with Router

I'm encountering a rather unusual problem when using SSH to connect to one of my routers. My connection remains stable for precisely two minutes before I'm abruptly disconnected with the error message "client_loop: send disconnect: broken pipe". Subsequently, any attempt to reconnect immediately results in a "connection refused" error, which lasts for exactly two minutes. After this period, I'm able to reconnect, only for the cycle to repeat itself.

I've looked into potential solutions and tried adjusting the TCP keepalive settings, as I came across suggestions that this might help with connections being dropped during periods of inactivity. However, this doesn't seem to be the root of my problem since these disconnections occur even while I'm actively using the connection.

Any suggestions would be greatly appreciated!

It's only the SSH connections that fail? Other traffic flows normally?

Is dropbear running smoothly? Any messages on the log?

Yes, it is only the ssh connection that fails.

I dont have any indication that dropbear isnt running smoothly, so i assume so.
I previously had some logs about maximum concurrnet dns queries and i tried disabling dns to resolve it, but it only got rid of the dns query logs. The ssh isssue did not get affected and still had the same pattern of 2 min on 2 min off.

I could be wrong, but this does not seem to be related to DNS at all. This is either some device or firewall in the path blocking the traffic, or the dropbear daemon failing down.

MTU settings/ MSS clamping?

2 Likes

I believe MTU is 1500 and mss clamping is enabled.

All devices agree on the time/date?

I think so. How would you check this?

messed this up somehow.

Right, thought it was something else that i missed. In that case, yes, they all agree on time. I have multiple routers all running the exact same configuration, but for some reason 2 of them have the issue i explained in the initial post.

Would you diagram that?

Internet
|
v
[ APN ]
|
|-------[ Router 1 ]---[ Client 1 ]
|
|-------[ Router 2 ]---[ Client 2 ]
|
|-------[ Router N ]---[ Client N ]
|
[ JumpHost ]
|
|
|
'---> Access to Routers and Clients

Does this make sense?

Yes, it answers if the router are remote and their order. The OP said one router but now it is two; which is no problem just making sure it always was 2 and not spreading.
Which two is it?

Also, is there a physical way around the jumphost?

I'm not sure what you mean, there is no explicit ordering of the routers.

I can connect via lan to avoid jumphost, if thats what you are asking.

Which routers are kicking you?

If you eliminate the jumphost and ssh in, are you still kicked in 2 minutes?

Are you running something like fail2ban or crowdsec which might be kicking you out?