I am connected to a VPN network through a pptp connection. The target network does not provide Internet access, thus I can't connect to it. How should I route my Internet traffic through my existing connection?

Below, are my existing routes

Destination     Gateway         Genmask         Flags Metric Ref   Use Iface
default         U     50     0        0 ppp0
default         _gateway         UG    20600  0        0 wlp4s0
link-local     U     1000   0        0 docker0     U     0      0        0 docker0   U     600    0        0 wlp4s0
_gateway UH    600    0        0 wlp4s0 UH    50     0        0 ppp0    _gateway UGH   0      0        0 wlp4s0    _gateway UGH   600    0        0 wlp4s0

The answer is to setup a default route. I do this:

sudo ip route add default via metric 40

where: = local gateway (not VPN gateway)
metric 40 = Some metric that is lower than your existing default route

In simple steps:

  1. Without being on VPN use ip route and note the line beginning with default (proto, dhcp aren't important)
  2. Connect to VPN
  3. Use ip route add, then append the line you noted before, but make the metric lower than anything that may currently exist.

With this setup, I can access all intranet tools that would normally be available via a VPN, while diverting all internet traffic away from it.

Edit: I saw your updated routing table. is probably the route you want, and metric 40 will work because it's lower than the default VPN route which is 50.

  • that metric does the trick. – Davood Falahati Aug 9 '20 at 20:42
  • Oops, I changed the routing and I have an access to internet. However, vpn network becomes inaccessible. – Davood Falahati Aug 9 '20 at 21:00
  • 1
    Do you know the IP range of your VPN stuff? Let's say it's 10.10.x.x. You could add a route with: sudo ip route add via dev ppp0. Then anything within that IP range will be sent via your VPN. – Stewart Aug 10 '20 at 5:09
  • You can always ip route del X where X is the route printed when you type ip route – Stewart Aug 10 '20 at 5:10
  • your suggestion does the trick, but I made it in this way: sudo ip route add dev ppp0 – Davood Falahati Dec 28 '20 at 6:35

Your VPN connection is overriding your default route (, and most likely your DNS resolvers. You could suppress or override both those things and just have specific routes to the ranges you're interested in on the target network.

  • I have updated my question, would you please provide a more explicit solution? – Davood Falahati Aug 9 '20 at 18: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.