Page 1 of 1

Autoconnect to VPN and block all non-vpn traffic

Posted: Wed Sep 05, 2018 12:43 pm
by mintymin
Hey all, relatively new to mint. I use protonvpn via openvpn for VPN connection in mint. The issue i am finding is that there is no easy way to have it automatically connect to the VPN on start-up. Further, I have multiple country VPN"s that I have setup that appear in the network manager GUI, and if I am already connected to one, I can "connect" to another, but the gui shows both are connected... Lastly, there's no good way to notice when the connection has been lost without manually checking IP's, so I'd like to be able to block all non-vpn traffic.

To summarize
- Auto-connect to vpn on boot / or disconnect
- block connections without VPN

In reading through the posts on the protonvpn site, it appears the only way to do this is with a script, which is far above my pay grade in linux. Discussions I have seen say its really simple and straight forward but no one offered examples. If someone is willing to help me out with this I'd be happy to compensate their time. Thanks!

Re: Autoconnect to VPN and block all non-vpn traffic

Posted: Wed Sep 05, 2018 12:51 pm
by Carl
Would also be interested in the responses to this I have been having to manually disconnect from VPN's in the network manager from the terminal as It doesn't do that if you click on another VPN as you say...

lists connections:

Code: Select all

nmcli con
disconnects connection:

Code: Select all

nmcli con down id [insert network connection name]
also you might want to check your not getting any DNS leaks with ipleak.net etc. as many seem to have to plug leaks if they are using the network manager to connect to vpn's viewtopic.php?f=90&t=260970

Re: Autoconnect to VPN and block all non-vpn traffic

Posted: Wed Sep 05, 2018 12:57 pm
by mintymin
Carl wrote:
Wed Sep 05, 2018 12:51 pm
Would also be interested in the responses to this I have been having to manually disconnect from VPN's in the network manager from the terminal as It doesn't do that if you click on another VPN as you say...

lists connections:

Code: Select all

nmcli con
disconnects connection:

Code: Select all

nmcli con down id [insert network connection name]
also you might want to check your not getting any DNS leaks with ipleak.net etc. as many seem to have to plug leaks if they are using the network manager to connect to vpn's viewtopic.php?f=90&t=260970
Hey, yes your right at one point I was definitely having major leak problems this was weeks ago. I cannot remember exactly how I resolved that, but I did find a solution cause I am not leaking any more. But if the connection is lost for any reason, there's no way to notice unless specifically go and check my IP. Hence why I want to just block all non-vpn traffic. On windows, or android (never used mac), this is very straight forward and so easy to do, but I haven't figured it out on mint yet.

Re: Autoconnect to VPN and block all non-vpn traffic

Posted: Thu Sep 06, 2018 5:26 pm
by greerd
Could you post the output of inxi -Fxz from a terminal?