As I move around from home to various other places different systems that I connect to from my laptop become 'local'. Being a lazy person I really don't want to type in long complicated ssh commands when I'm connecting remotely. Thus I have in the ~/.ssh/config file the following:-
Host cheddar HostName cheddar.halon.org.uk
Host halon HostName cheddar.halon.org.uk
Host chris ProxyCommand ssh cheddar nc -q0 zbmc.eu 22
Host odin ProxyCommand ssh cheddar nc -q0 localhost 51234
This means I can simply type 'ssh chris' or 'ssh odin' and ssh with the above config file does all the hard work for me.
However it means that when I'm at home for example (where 'chris' is my desktop on the LAN) if I type 'ssh chris' I get connected to my desktop machine via the internet which is rather ridiculous.
Can anyone come up with an easy way to change how 'ssh chris' acts according to whether I'm on the LAN where 'chris' is or not. Similarly I want the same to happen when I'm on the LAN where 'odin' is (which is not the same LAN).