I am trying to resolve the following problem: I need to be connected to my company's Mikrotik router to reach company's NAS server. It works well. But if I stay connected all the time then all my internet traffic goes through VPN connection and consequentially it is painfully slow. So how can I force my internet traffic to avoid VPN connection? I believe that it can be solved through VPN settings in Network Manager (GUI) but ticking off "only use for local resources" at Routes in IPv4 just doesn't work - in such case VPN connection is established, internet avoids VPN but it fails to reach NAS server. Any suggestions?
-
Check your company's Internet Access Policy - you may be about to violate it by subverting the purpose of VPNs. Don't get fired over this. Don't do it.– waltinatorSep 15, 2016 at 12:57
-
@waltinator, It's OK, I checked it. It is no violation. Company encourages this.– Peter MSep 15, 2016 at 13:26
1 Answer
You need to have a route to you NAS server that goes along the VPN. Having the default-route on the VPN is apparently a way to achieve that (depends on details of your networking configuration and environment).
Yes, "only use for local resources" configures the presence of the detault-route.
Often you get automatically specific routes to reach the resources on the VPN. If that doesn't happen, it could be a misconfiguration in the VPN server, on your side or a bug.
Regardless whether that works automatically, you can also add manual, static routes. Find out the IP address you want to reach (ping NAS-SERVER
, or ask your admin). Possibly, you don't only add a route to that one IP address, but an entire subnet (like 10.0.0.0/8). You can configure that in your NetworkManager GUI. Afterwards re-activate your VPN connection.
Check the assignes routes with ip route
.
You might also try traceroute -n NAS-SERVER
to see the way that your IP packets take.
-
Thanks. Unfortunately you told this way-over my ability to comprehend. This is what I get:peter@BareBone:~$ ip route default dev ppp0 proto static scope link metric 50 default via 192.168.1.1 dev eth0 proto static metric 100 85.10.37.25 via 192.168.1.1 dev eth0 src 192.168.1.101 169.254.0.0/16 dev eth0 scope link metric 1000 192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.101 metric 100 192.168.10.235 dev ppp0 proto kernel scope link src 192.168.10.239 metric 50 Unfortunately I have no Idea which value to use and where to put it.– Peter MSep 21, 2016 at 10:51