For Linux and macOS, add these lines to .ssh/config# Default configuration for the target when it is local
Host target.domain.name
HostName target.domain.name
# Override and apply ProxyJump only if the target is NOT locally reachable
Match host target.domain.name exec "! ping -c 1 -t 2 target.domain.name >/dev/null 2>&1"
ProxyJump proxy.domain.name:22
And slightly differently for Windows, add these lines to .ssh\config
Host target.domain.name
HostName target.domain.name
Match host target.domain.name exec "cmd /c ping -n 1 -w 1000 target.domain.name >nul 2>&1 || exit 0"
ProxyJump proxy.domain.name:22