SSH Hang and Timeout after 30 to 60 Seconds After Login with Pipe-Broken

Mindwatering Incorporated

Author: Tripp W Black

Created: 03/01/2019 at 02:01 AM


OS X Tips & Hints
General Mac Tips

SSH from our Macs upgraded to Mojave and High Sierra have issues connecting to servers on another subnet. We know the issue is that they are dropped on the way back. We know they make it through the bridge VM, and die between the router and our Macs. If we use ssh or putty w/in a Windows 7 VM in Bridge mode, then SSH maintains a connection successfully.

We tried opening additional access rules by removing restrictions that only permitted certain IPs from using SSH to the neighboring subnet.
We tried changing the hop count for the static route in the main gateway to a higher number, and then a lower number.
We tried changing the /etc/sshconfig on the server hosts, and the local ~/.ssh/config files to add keep alives, etc. All that did was make the hang before the pipe-broken message take longer.
We tried wireless and wired connections, no difference.

Solution / Workaround:
Although all evidence indicated that the packets were being lost on the way back, we decided to try setting up the static route in the mac directly.

In this example, the local LAN network is, and the neighboring LAN is The bridge virtual device is at

Applications --> Utilities --> Terminal

$ networksetup -listallnetworkservices
--> returned the list of network options. We were using a wired connection: Ethernet
$ sudo networksetup -setadditionalroutes Ethernet
<enter password>
$ networksetup -getadditionalroutes Ethernet
--> returned the route above that we just tried.
$ ssh myadminid@

The connection stayed consistent.

To remove all additional routes for an adapter, do the following command:
$ sudo networksetup -setadditionalroutes Ethernet

Static Route
Routing Table

previous page