I have an OpenVPN tun0

There is an interface on the server eth1 for

I would like to route the OpenVPN connections to access the network.

I can connect to the VPN from my client, I get an ip of but on the server it will not route the traffic from tun0 to eth1. When I do a tracerout for it shows going out towards but stops right there.

If I try to ping on the server from tun0 I get no response. ping -I tun0

Anyone can please help me what do I need to add on the server to get the routing and the NAT working?



it seems you need to update two part of your configuration.

Push route from your server conf file, just add the following line

 push "route"

Then you need to NAT all traffic coming from so then your device on will know where to route back the paquet to VPN client. Just run this command on your server.

iptables -A POSTROUTING -s -o eth1 -j MASQUERADE

Also double check you have ip forwarding enable on the server by commented out the line net.ipv4.ip_forward=1 from the file /etc/sysctl.conf. Then run the command sysctl -p to enable the rule.


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.