This paper explains how SSH tunnels work. It also explains how you can use OpenBSD and OpenSSH to connect 2 windows LANS to each other over the internet. SSH provides
a secure way to do this and this paper aims to explain a suitable solution to this problem.