-1

I find a lot of answers to exclude 1 host from the VPN tunnel, but I would like to achieve the opposite. My server at home gets an internal IP from the ISP, so I've set up a VPN connection so that I can access it from an OpenVPN server in a datacenter.

By default all the traffic on the client is routed through the VPN tunnel, but that's not what I want. All traffic should go via the normal network card (which is much faster) and only traffic from and to the OpenVPN server should go via the tunnel.

Is there a way to achieve this? (I'm running Debian.)

migrated from stackoverflow.com Sep 1 '17 at 12:52

This question came from our site for professional and enthusiast programmers.

0

Openvpn does not redirect all traffic by default, if it's doing that then someone has configured it to do so.

Typically this is done using the "redirect-gateway" setting in the openvpn configuration. This can be set from either the server or the client.

What i'm not sure is if there is a way to override server-pushed configuration from the client if you control the client but not the server.

  • Seems it was this line on the server side which was redirecting all traffic over the VPN tunnel: push "redirect-gateway def1 bypass-dhcp" I can't recall adding this line myself, so I assume this is done by default. – Greggy Sep 1 '17 at 14:22
  • I would guess you copied an example from somewhere without fully understanding it. – plugwash Sep 1 '17 at 15:03
0

I think you need to create a few routes in route table. If the destination matches the subnet of data center, then go to tunnel IP address. Others still go to network card.

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.