In ubuntu, it's simple.
I will assume you have 10.04 and higher. I have no experience to the earlier versions.
First, install the required components, I do it this way:
1. apt-get update -y (I will always do this first, more of an impulse)
2. apt-get install openvpn nano wget iptables -y
3.
copy some openvpn files
cp -R /usr/share/doc/openvpn/examples/easy-rsa/ /etc/openvpn/
4.
go to the directory to set your certificates
cd /etc/openvpn/easy-rsa/2.0/
source ./vars
./clean-all
./build-ca (this will ask you a few things, just answer it)
./build-key-server server (this will ask you a few things, just answer it)
./build-dh
5. upload your server config file to the /etc/openvpn directory
6. run openvpn using this command - service openvpn start
7. create iptables, depending on the subnet you use in the openvpn config, I do it using this command:
iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o venet0 -j SNAT --to vpsIPhere
I used 10.0.0.0 as a subnet.
This works assuming you already have tun/tap enable by your host.
If this post helped, kindly give me a like
