When I\'m on a certain network (subnet is 10.10.11.x) I need to jump through an intermediate host to reach my destination because of destination port I can\'t change and limited
I'm using the following function for that:
function ssh() {
network=`networksetup -getairportnetwork en0 | cut -d: -f2 | tr -d [:space:]`
if [ -n "$network" -a -f $HOME/.ssh/config.$network ]; then
/usr/bin/ssh -F $HOME/.ssh/config.$network "$@"
else
/usr/bin/ssh "$@"
fi
}
export -f ssh
So I need a separate configuration file for each WiFi network where I want a custom solution. It works for me right now, but it's ugly. I can recommend it only as an idea, not as the best solution.
I'd be glad to know any better solution.