Page 1 of 1

OpenVPN and internet access

Posted: Wed Jan 09, 2019 9:01 pm
by jaydawg

I've set up an openvpn access server in my AWS account. All went well, I can SSH into its shell, get to the admin console, add a user, connect to that user. However, when connected I don't have other internet access and I need to. I've read many pages on this but none have worked. The OpenVPN docs ( ... /#redirect) say to add these:

push "redirect-gateway def1"
push "dhcp-option DNS"

To the server config file. I am running 2.6.1 of Open VPN on my EC2 instance - so is the "server config file" /usr/local/openvpn_as/etc/as.conf? I assumed it was even though I wasn't sure because this file seems to be key/value pairs not push statements. I added the two entries above (i opeted to use Google's DNS server) and then did the following per the docs:

iptables -t nat -A POSTROUTING -s -o ens0 -j MASQUERADE

Note that I am on a 10.x.x.x subnet and that my interface is named ens0. I see other interfaces (as0t0 through as0t3) which I assume are associated with the access server, so I also ran the above iptables command on all those. All of this to no avail :(

So how do I configure my EC2 instance of OpenVPN to also allow internet traffic? I am totally stumped.

Re: OpenVPN and internet access

Posted: Wed Jan 09, 2019 9:19 pm
by novaflash
No, don't do any of those things.

Just go to VPN Settings and scroll down to the settings that enables or disables redirecting all client internet traffic through the VPN server. Set that to disabled if you don't need it, and if you set it to enabled, next scroll down to the DNS server settings. Set the DNS server manually and specify a public DNS server that works, for example, google's public DNS, or just disable the DNS setting altogether.

Save settings and update running servers and things should be working fine then.

Re: OpenVPN and internet access

Posted: Wed Jan 09, 2019 9:44 pm
by jaydawg
OMFG thank you so much! That worked, I've been banging my head with this for the last 2 days, thanks again!