Had to redo my Mac recently and started having problems with ssh to a Juniper firewall. I could ssh into the firewall but would be dropped 30 seconds later. Took me a while to get the search terms right but eventually found this post explaining the situation.
The problem was I had a custom ssh config file in ~/.ssh/config and had ServerAliveInterval set to 30(ServerAliveInterval=30). Had to add an extra rule for the firewall and set that value to 0.