Turn VPN on when connecting to WIFI

Discussion in 'Tasker' started by rainer.lang, Dec 25, 2017.

  1. rainer.lang

    rainer.lang New Member

    Joined:
    Dec 25, 2017
    Messages:
    7
    Likes Received:
    0
    Situation:
    I have different WIFIs which I trust, like my own or brother - "trusted WIFI".
    For other WIFIs I'm using VPN with my own router.
    If I connect to a trusted WIFI, all is fine - I don't need VPN.
    But if I connect to all others WIFIs, I switch the VPN connection on.

    with Tasker possible?
    Automate the turn on/off of the VPN connection using a list of "trusted WIFIs" when I connect to the WIFI.
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,070
    Likes Received:
    692
    How do you normally turn on the VPN? Maybe you can do it with AutoInput?
     
  3. rainer.lang

    rainer.lang New Member

    Joined:
    Dec 25, 2017
    Messages:
    7
    Likes Received:
    0
    Of course I could turn on VPN via AutoInput - but there is more I want....
    But I want to turn it automatically on when I'm NOT in special WIFIs. How could I do it? How to automatically turn on VPN when connecting to a NOT-trusted WIFI (give a list of trusted WIFI-names)?
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,070
    Likes Received:
    692
    Maybe you could use AutoTools connectivity action to get all available wifis?
     
  5. rainer.lang

    rainer.lang New Member

    Joined:
    Dec 25, 2017
    Messages:
    7
    Likes Received:
    0
    How to react on connecting to a WIFI? How do I start?
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,070
    Likes Received:
    692
    Use the built-in Tasker state condition called Wifi Connected.
    Hope this helps! :)
     
  7. rainer.lang

    rainer.lang New Member

    Joined:
    Dec 25, 2017
    Messages:
    7
    Likes Received:
    0
    Found it, but it's not triggered if I turn on the wifi AND use a SSID. Without the SSID it's triggered without any problem. I'm very sure that the SSID is correct.
     
  8. rainer.lang

    rainer.lang New Member

    Joined:
    Dec 25, 2017
    Messages:
    7
    Likes Received:
    0
    I ll try it tomorrow. I think I found something.
     
  9. Schroeder

    Schroeder New Member

    Joined:
    Dec 12, 2017
    Messages:
    6
    Likes Received:
    0
    Did you ever get this figured out? I'm currently attempting the same thing in my pixel 2xl with my wireguard VPN and azire VPN configuration files? WG has built in

    Sent from my Pixel 2 XL using Tapatalk
     
  10. andy o

    andy o New Member

    Joined:
    Oct 4, 2018
    Messages:
    2
    Likes Received:
    0
    I used to do this with OpenVPN for Android and a Tasker plugin for it. Bear in mind the plugin is from a different developer. It might be easier to set up if you're using a commercial VPN with its own app. For instance I can set up the PIA app to just launch and connect automatically when Tasker triggers.
     
: tasker

Share This Page