Autoconnect to VPN and block all non-vpn traffic

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
mintymin
Level 1
Level 1
Posts: 18
Joined: Tue Jul 24, 2018 6:54 am

Autoconnect to VPN and block all non-vpn traffic

Post by mintymin » Wed Sep 05, 2018 12:43 pm

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!

User avatar
Carl
Level 5
Level 5
Posts: 695
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 » 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

mintymin
Level 1
Level 1
Posts: 18
Joined: Tue Jul 24, 2018 6:54 am

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

Post by mintymin » Wed Sep 05, 2018 12:57 pm

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 5
Level 5
Posts: 985
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 » Thu Sep 06, 2018 5:26 pm

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

Post Reply

Return to “Other networking topics”