Home > Uncategorized > Client OpenVPN as NAT Gateway Router to Local Network

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 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 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

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: