Time to set up a virtual private network!
For this to work, you need both a home, and a work, two BubbaTwo, internet connection available at both work and home, and at least one of those connections must be externally accessible; for most people, this is usually home, as at work, the corporate firewall might not happily comply.
So with the basic assumption that home is our central location, we will host the "server" there.
First we SSH into the two bubbas and issues the command as root:
Code: Select all
apt-get install openvpn
Also copy /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz to /etc/openvpn and gunzip it
At the office bubba, copy /usr/share/doc/openvpn/examples/sample-config-files/client.conf to /etc/openvpn.
At home bubba, cd to /root/easy-rsa
Edit the file vars, and enter the required values at the bottom, KEY_COUNTRY is the two letter country code.
Now issue following command:
Code: Select all
. ./vars
./clean-all
./build-ca
Now issue:
Code: Select all
./build-key-server server
And again:
Code: Select all
./build-key client
We continue now by creating Diffie Hellman parameters:
Code: Select all
./build-dh
Now copy the ca.crt, server.crt, server.key and the dh1024.pem file from the keys dir to /etc/openvpn;
Copy magically ca.crt, client.crt, client.key to the office bubba in /etc/openvpn.
now enter /etc/network and edit the firewall.conf, add following:
Code: Select all
-A INPUT -i tun+ -j ACCEPT
-A FORWARD -i tun+ -j ACCEPT
-A INPUT -i eth0 -p udp -m udp --dport 1194 -j ACCEPT
Code: Select all
-A INPUT -i tun+ -j ACCEPT
-A FORWARD -i tun+ -j ACCEPT
Code: Select all
iptables-restore < firewall.conf
On the server, edit /etc/openvpn/server.conf
at the line starting with "server", set e unique network on both places.
In the client.conf file at the office, set the remote to your home ip/dns.
now on both, issue
Code: Select all
/etc/init.d/openvpn restart
'
That is basically it, more information can be found in http://openvpn.net/index.php/documentation/howto.html
/Carl