1. Download our Official Android App: Forums for Android!

Support VPN on/off

Discussion in 'Android Help' started by zkab, May 31, 2016.

  1. zkab

    zkab Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    22
    Joined:
    Apr 15, 2010

    Apr 15, 2010
    22
    0
    15
    Sweden
    I have OpenVPN Connect for Android 6.0.1 and want to dis/re-connect when I enter/leave my home wifi network.
    How can that be done ?
     

    Advertisement

  2. girolez

    girolez Often Off Piste
    Rank:
     #47
    Points:
    543
    Posts:
    3,847
    Joined:
    May 29, 2011

    May 29, 2011
    3,847
    1,919
    543
    Male
    Retired
    Les Gets, France
    Hi

    I use that app on my note 4 with Private Tunnel vpn service. Once the app is started and connected, I can turn off my wifi and/or go out of range and it of course disconnects - when I return or turn it back on it automatically reconnects. Just leave the app running. Its the only vpn app I could find that does this.

    If you want it to only connect on your home network (and nowhere else) you would need to use Tasker or similar (I have never tried to do this)
     
  3. zkab

    zkab Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    22
    Joined:
    Apr 15, 2010

    Apr 15, 2010
    22
    0
    15
    Sweden
    I want the opposite - when I am within range of my wifi home network it should disconnect and outside my wifi home network it should connect - howto do that with Tasker I don't know.
     
  4. girolez

    girolez Often Off Piste
    Rank:
     #47
    Points:
    543
    Posts:
    3,847
    Joined:
    May 29, 2011

    May 29, 2011
    3,847
    1,919
    543
    Male
    Retired
    Les Gets, France
    I understand why you want that.

    Using macrodroid I can open the app when leaving home and close it when returning, but I still need to manually press "connect" after the app opens. I guess I could have a macro to sound a reminder for me to do this. Not sure how to automate it.

    Once on, the app should autoconnect to any network your phone uses until it turns off when you next get to your home Wi-Fi
     
  5. zkab

    zkab Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    22
    Joined:
    Apr 15, 2010

    Apr 15, 2010
    22
    0
    15
    Sweden
    OK - I maid a try with Tasker ...
    I tested the tasks Connect & Disconnect separately and they worked but it seems that Tasker don't start them when the correct conditions are meet.
    My home wifi is Neverland.
    Disconnect should stop OpenVPN and Connect should start it.
    Please check attachments.
     

    Attached Files:

    • VPN.jpg
      VPN.jpg
      File size:
      36 KB
      Views:
      49
  6. zkab

    zkab Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    22
    Joined:
    Apr 15, 2010

    Apr 15, 2010
    22
    0
    15
    Sweden
  7. El Presidente

    El Presidente Beware The Milky Pirate!
    Moderator
    Rank:
     #5
    Points:
    3,118
    Posts:
    32,120
    Joined:
    Jan 3, 2011

    Jan 3, 2011
    32,120
    24,096
    3,118
    Scotland
    It looks like you have 2 contexts setup? Have you tried adding Disconnect as an Exit Task to the first context?
     

Share This Page

Loading...