OpenVPN and internet access

Post Reply
jaydawg
OpenVpn Newbie
Posts: 2
Joined: Wed Jan 09, 2019 8:36 pm

OpenVPN and internet access

Post by jaydawg » Wed Jan 09, 2019 9:01 pm

Hello,

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 (https://openvpn.net/community-resources ... /#redirect) say to add these:

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

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 10.0.0.0/16 -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.

novaflash
I should be on the dev team.
Posts: 993
Joined: Fri Apr 13, 2012 8:43 pm

Re: OpenVPN and internet access

Post by novaflash » Wed Jan 09, 2019 9:19 pm

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 8.8.8.8, or just disable the DNS setting altogether.

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

jaydawg
OpenVpn Newbie
Posts: 2
Joined: Wed Jan 09, 2019 8:36 pm

Re: OpenVPN and internet access

Post by jaydawg » Wed Jan 09, 2019 9:44 pm

OMFG thank you so much! That worked, I've been banging my head with this for the last 2 days, thanks again!

Post Reply