Title. Is that possible? I have proton vpn setup at the network layer at home so there is no need for the app on my phone or laptop to be connected when at home. However I would like it to auto connect when I connect outside of my house. As anyone done this before? This would specifically be for android and windows devices if that matters.

  • marighost@lemm.ee
    link
    fedilink
    English
    arrow-up
    6
    ·
    3 days ago

    I wonder if you’d be able to set up a rule in something like Tasker (Play store link, sorry) to activate the tunnel when you’re off your home network. I haven’t used Tasker in years though, sorry.

    • JustEnoughDucks@feddit.nl
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      3 days ago

      Hey, I have done something similar to this.

      I turn the VPN on every time I connect to a WiFi without the SSID of my trusted places.

      Super easy with tasker.

      Here is the XML to import and experiment with OP:

      <TaskerData sr="" dvi="1" tv="6.4.15">
      	<Profile sr="prof7" ve="2">
      		<cdate>1693206728189</cdate>
      		<edate>1742652330550</edate>
      		<flags>8</flags>
      		<id>7</id>
      		<mid0>8</mid0>
      		<mid1>9</mid1>
      		<nme>VPN Automation</nme>
      		<State sr="con0" ve="2">
      			<code>160</code>
      			<pin>true</pin>
      			<Str sr="arg0" ve="3">HomeWifi/telenet-C6DE3/My VW 4685</Str>
      			<Str sr="arg1" ve="3"/>
      			<Str sr="arg2" ve="3"/>
      			<Int sr="arg3" val="2"/>
      		</State>
      		<State sr="con1" ve="2">
      			<code>110</code>
      			<pin>true</pin>
      			<Int sr="arg0" val="1"/>
      			<Int sr="arg1" val="1"/>
      			<Int sr="arg2" val="1"/>
      			<Int sr="arg3" val="1"/>
      			<Int sr="arg4" val="1"/>
      			<Int sr="arg5" val="0"/>
      		</State>
      		<State sr="con2" ve="2">
      			<code>160</code>
      			<Str sr="arg0" ve="3"/>
      			<Str sr="arg1" ve="3"/>
      			<Str sr="arg2" ve="3"/>
      			<Int sr="arg3" val="2"/>
      		</State>
      	</Profile>
      	<Task sr="task8">
      		<cdate>1693214693841</cdate>
      		<edate>1694095080534</edate>
      		<id>8</id>
      		<nme>Turn On VPN</nme>
      		<pri>100</pri>
      		<Action sr="act0" ve="7">
      			<code>365</code>
      			<Bundle sr="arg0">
      				<Vals sr="val">
      					<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""/&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
      					<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
      				</Vals>
      			</Bundle>
      			<Str sr="arg1" ve="3">WireGuardSetTunnel(true,BE-wg)</Str>
      		</Action>
      	</Task>
      	<Task sr="task9">
      		<cdate>1693214759029</cdate>
      		<edate>1693374826981</edate>
      		<id>9</id>
      		<nme>Turn Off VPN</nme>
      		<pri>100</pri>
      		<Action sr="act0" ve="7">
      			<code>365</code>
      			<Bundle sr="arg0">
      				<Vals sr="val">
      					<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""/&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
      					<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
      				</Vals>
      			</Bundle>
      			<Str sr="arg1" ve="3">WireGuardSetTunnel(false,BE-wg)</Str>
      		</Action>
      	</Task>
      </TaskerData>
      
      
      • blinkfink182@lemm.eeOP
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 days ago

        Thanks for that! I did consider seeing if tasker could do that as I used it a lot when I used to run android as my daily driver (was on iOS for a long time and finally flipping back).

        Appreciate the example!

  • AarynBlack@lemm.ee
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    3 days ago

    I use Express VPN and the app has the ability to connect to VPN automatically when not on trusted networks. You can white-list any Wi-Fi you trust and anything not on the white-list gets automatic VPN connection. I assume most VPN providers offer similar options.

    Edit: You can also white-list or black-list the Mobile Network.

  • jaschen@lemm.ee
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    3 days ago

    I do the opposite. I turn on my VPN at home. I share Netflix with my bro in law and don’t want to get caught being in different places. On my Samsung Fold 5, I can run a routine to connect to VPN when I get home.