Autoconnect to VPN and block all non-vpn traffic

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
mintymin

Autoconnect to VPN and block all non-vpn traffic

Post 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!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Carl
Level 5
Level 5
Posts: 701
Joined: Wed Apr 15, 2009 5:20 pm
Location: Isle of Wight, UK

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

Post 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
mintymin

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

Post 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.
User avatar
greerd
Level 6
Level 6
Posts: 1060
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

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

Post by greerd »

Could you post the output of inxi -Fxz from a terminal?
Locked

Return to “Networking”