OpenVPN Settings and iptables configured for Amazon AWS EC3 Server

Revision as of 20:18, 29 January 2020 by Ardaut (talk | changes)

Add or edit the following in the OpenVPN config file - server.conf

port 1194
proto tcp-server dev tun1

You can also change other settings as you wish. But you have to add the command ifconfig.

Setting up iptables

Add this iptables command to allow Internet access to your VPN clients.

sudo iptables -t nat -A POSTROUTING -s -o eth0 -j MASQUERADE
sudo iptables -t nat -A POSTROUTING -s -o eth0 -j MASQUERADE

Allow IP forwarding as well:

echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward

Do not forget to allow access to the port 1194. Please check for that your firewall settings in your server and Amazon AWS console settings.