I have installed OpenVPN with certificates using this tutorial: https://www.digitalocean.com/community/tutorials/how-to-setup-and-configure-an-openvpn-server-on-centos-7 and i use static ip adress with ccd directory.

How can I configure the OpenVPN client to ONLY route traffic through the VPN that is destined for a single, specific IP address?


The server is CentOS 7 and the client is Ubuntu


Add to the server config:

push route 10.8.0.x
  • Does not work, add line to end of server.conf, reboot server and client servce but whatismyip.com says the ip adress is ip of vpn server. – e-info128 Jul 9 '16 at 19:12
  • Do you use redirect-gateway in your configs? As mentioned in the article you sent: "We need to uncomment the push "redirect-gateway def1 bypass-dhcp" line, which tells the client to redirect all traffic through our OpenVPN." push "redirect-gateway def1 bypass-dhcp" – Yarik Dot Jul 9 '16 at 19:16
  • Works fine, i need "route-nopull" before push route and it in client config no server config. – e-info128 Jul 9 '16 at 19:25
  • @e-info128 Could you be more specific of what you put in the client config? – mtnpaul Dec 8 '18 at 7:51

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.