October 8, 2010 - kenshinjeff

Setting up a vpn with a vps

Basically if you happen to have a vps lying around you can install openvpn on it, and create your own vpn. There are some useful things you can do with this kind of vpn setup but most people use it for the following reasons:

– Secure remote/mobile access to confidential work files
– Anonymity (ie, hide porn/torrent traffic from your isp)
– Creating a VPN LAN to play games
– Cost savings as compared to leased lines

It’s a cool way to access your shared files at home via your mobile device too you know.

Anyhows it’s available for most platforms, and here’s the page to set it up.
http://openvpn.net/index.php/open-source/documentation/howto.html#quick

What’s different about setting it up on a vps is that you need the following to be configured by your service provider first before you use it.

TUN/TAP device enabled on your VPS
iptables NAT support

And here are the additional commands:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o venet0 -j MASQUERADE

or

iptables -t nat -A POSTROUTING -s ASSIGNED.VPN.IP.ADDRESS -j SNAT –to VPN.IP.ADDRESS.HERE

REF: http://www.specialvps.com/setup-vpn-server-centos-vps-instantly/
REF: http://www.specialvps.com/install-openvpn-debianubuntu-vps-instantly/

geeky stuff / interesting stuff

Comments

  • Elmer says:

    NC backs up /etc/hosts and /etc/resolv.conf to /etc/jnpr-nc-hosts.bak and /etc/jnpr-nc-resolv.conf respectively. It tries resorte them once you disconnect, so all you need to do is to edit all four of them when things get nasty and you’re good to go 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *