I need to setup our openvpn server to allow all traffic togo through it when we connect(as we need to whitelist its public IP address). The problem I'm having is that once I start to route all traffic through vpn I lose all connectivity. Here's my config:

ifconfig-pool-persist /tmp/ipp.txt

push "route"
push "redirect-gateway def1"
push "dhcp-option DNS" is VPC dns server ip address. When I connect to vpn and try traceroute I get the following:

traceroute to (, 64 hops max, 52 byte packets
 1  ip-172-16-253-1.eu-west-1.compute.internal (  30.283 ms  15.633 ms  16.482 ms
 2  * * *

This is where it stops. My route tables point to the EC2 instance hosting openVPN. Why is it not working and what am I missing? Source/Dest check is disabled.

  • I think you have to enable forwarding on the server – davidbaumann Dec 11 '18 at 15:03
  • @davidbaumann yes, I already figured this one out(with this command- iptables -t nat -A POSTROUTING -s IP ADDRESS -o INTERFACE -j MASQUERADE). I NAT the traffic to the internet. My next problem is security group which does not allow this to work. Do you know perhaps which address and port I need to allow to make natting work? – davidb Dec 11 '18 at 16:20

To answer my own question. I had to change interface as in aws eth0 etc are not available. In my case it was ens5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.