When connecting to my M1 mac mini over ssh, certain programs are often unable to reach network destinations in the corporate LAN, although they can usually reach external addresses like www.apple.com. For example, a java program attempting to download from teamcity.dev.corp.com:8111 often fails like:
java.net.NoRouteToHostException: No route to host
Running the exact same command from the Apple Terminal program works like normal, simply connecting over ethernet on en0 to a TeamCity server inside the same building.
Basic diagnostics from the ssh session do not show anything unusual:
> traceroute teamcity.dev.corp.com
traceroute to teamcity.dev.corp.com (10.21.4.1), 64 hops max, 40 byte packets
1 teamcity.dev.corp.com (10.21.4.1) 1.702 ms 0.409 ms 0.336 ms
> route -n get teamcity.dev.corp.com
route to: 10.21.4.1
destination: 10.21.4.1
interface: en0
flags: <UP,HOST,DONE,LLINFO,WASCLONED,IFSCOPE,IFREF>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 0 0 0 1500 1194
> uname -a
Darwin mac 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:47 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T8103 arm64
Similar problems occur in docker commands to a remote daemon ("no route to host" or "connection refused"):
docker -H tcp://<ip>:<port> ...
Most other programs are never affected by this problem. Are there other diagnostic steps that might reveal the cause?