Client OpenVPN as NAT Gateway Router to Local Network
An OpenVPN server exists on the Internet. This is how an individual client will expose to all other clients of the VPN its private network.
The private network is 192.168.99.0/24. Create a ubuntu server installation.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install openvpn
Go to the VPN server and login admin. Configure your user profile as Admin/Auto-login and:
(not sure Admin is that important, need to remove and test)
The VPN server will now tell all clients that it will handle traffic for 192.168.99.0/24. Your client profile is now configured as a gateway for 99.0/24, so the server will NAT all traffic down the VPN to your client. However, your shiny new ubuntu client must then NAT the server traffic onto 99.0/24.
From http://codeghar.wordpress.com/2012/05/02/ubuntu-12-04-ipv4-nat-gateway-and-dhcp-server.
Everything up to Install DHCP server. Basically just enable routing and add the NAT iptables rules.
I like this post for creating your iptables https://wiki.debian.org/iptables
Log into the http openvpn server (LOGIN not CONNECT). Download your autologin profile, rename to .txt, open with WordPad (not Notepad).
Place the contents of this file in /etc/openvpn/client.conf on the ubuntu client.
Start OpenVPN client:
cd /etc/openvpn/
sudo openvpn client.conf