Connecting to internal machine via ssh ProxyCommand


The AskUbuntu question was: How do I SSH to machine A via B in one command?

This response worked for me:

Host <visible hostname alias>
        Controlmaster auto
        User <user>
        hostname <visible hostname>
        port <port>
        IdentityFile ~/.ssh/<id file>
Host <private LAN hostname alias>
     ProxyCommand ssh -q -W <private LAN hostname>:<private LAN port> <visible hostname alias>

Or in my particular case:

Host externalmachine.ca
        Controlmaster auto
        User externalmachineusername
        hostname externalmachine.ca
        port 22
        IdentityFile ~/.ssh/id_dsa.pub
Host internalmachinehostname
     ProxyCommand ssh -q -W internalmachineusername@internalmachinehostname:22 externalmachine.ca