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.
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
iptables -t nat -A POSTROUTING -s ASSIGNED.VPN.IP.ADDRESS -j SNAT –to VPN.IP.ADDRESS.HERE