I installed OpenVPN on an Ubuntu machine at home, but when I connect to it, all my network traffic goes through it. I don't want this to happen.

I would like to be able to see only the local LAN network, but not routing all traffic.

How could this be done?


  • 2
    --pull-filter ignore redirect-gateway? – Tom Yan Aug 14 '17 at 0:28
  • 2
    Also remove any redirect-gateway line in your client config. – Tom Yan Aug 14 '17 at 0:30
  • @TomYan The Client config does not have a redirect-gateway line. What should I do with the "--pull-filter ignore redirect-gateway"? Should I put it in the client config? – AnonUser456 Aug 14 '17 at 3:42
  • 2
    You can either put it in the config (without the --) or use it when you run openvpn (e.g. openvpn --config path/to/config --pull-filter ignore redirect-gateway) – Tom Yan Aug 14 '17 at 8:22

To condense Tom Yan's comments into an answer:

  • make sure there are no redirect-gateway lines in your client config
  • add the following line to filter out any redirect-gateway settings pulled from the VPN server:
pull-filter ignore redirect-gateway

The method is documented in https://community.openvpn.net/openvpn/wiki/IgnoreRedirectGateway, but it only mentions the --pull-filter command-line parameter, not how to add it to a config file.

  • It's strange I can get this to work under Linux but not Windows... – Chris Nevill Mar 5 at 9:53
  • OK for some reason under Windows I needed to add route-nopull (Aware this is a Ubuntu exchange but it still comes up high in Google search so maybe useful for some!) – Chris Nevill Mar 5 at 10:02

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.