On Sat, Sep 20, 2014 at 06:56:46PM +0100, Mark Rogers wrote:
On 20 Sep 2014 13:20, "Chris Green" <[1]cl@isbd.net> wrote:
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).
What provides your DNS when you're at the different locations?
dnsmasq on the LAN, whoever I'm connected to's DNS when elsewhere.
Simply make sure that whatever it is dishes out the local addresses. When you're away from that location the world visible DNS will give the external IP, when you're at the location the local DNS will override the world visible alternatives.
As I have pointed out in a previous reply this doesn't work because of the ProxyAddress stuff I have in my ~/.ssh/config file. I need some way to switch the ProxyCommand off when I'm on the LAN.