Friday, March 5, 2010

Quick VPN

Here is a fast and simple Open VPN configuration, it has no special features and uses a shared key for access, but you can have a VPN server running in about a minute. I tested it between the gentoo netbook, my linode, and a backtrack install.

On the server:
root@bt:/# cd /etc/openvpn
root@bt:/etc/openvpn# openvpn --genkey --secret quick.key
root@bt:/etc/openvpn# vim quickvpn.conf

  dev tun
  ifconfig 10.0.0.1 10.0.0.2
  secret quick.key

root@bt:/etc/openvpn# scp quick.key root@client.tld:.
root@bt:/etc/openvpn# /etc/init.d/openvpn start

On the client:
root@zombi:/# cp quick.key /etc/openvpn/.
root@zombi:/# cd /etc/openvpn
root@zombi:/etc/openvpn# vim quickvpnclient.conf

  remote vpnserver.tld
  dev tun
  ifconfig 10.0.0.2 10.0.0.1
  secret quick.key

root@zombi:/etc/openvpn# /etc/init.d/openvpn start
root@zombi:/etc/openvpn# ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=1.08 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=1.27 ms
^C

If you actually want to build a more permanent and secure vpn system, the Gentoo wiki has a great guide for that: http://en.gentoo-wiki.com/wiki/OpenVPN

0 comments:

Post a Comment