wgtunnel icon indicating copy to clipboard operation
wgtunnel copied to clipboard

[FEATURE] - Revamped Auto-tunneling settings for each tunnel

Open Dondrejohnson5 opened this issue 7 months ago • 2 comments

Is your feature request related to a problem? Please describe. I do find it slightly frustrating that firstly, auto-tunneling cannot currently detect whether the untrusted Wifi is metered or unmetered, in the case that I want to assign a tunnel for connections to a mobile Wifi hotspot (metered) and another to connections to my home network (unmetered). Secondly, I think it's a bad design that 1: if one tunnel is supposed to be used for anything that isn't mobile data or a specific Wifi name (as those are currently the only auto-tunneling options in the tunnel editing UI), that it must be marked as a primary/favorite tunnel, and that 2: other toggles like untrusted Wifi and Ethernet cannot be assigned to specific tunnels, as they are not included in the tunnel editing UI. They are only global toggles.

  • This means that, for example, a tunnel designated for Ethernet will not automatically enable on Ethernet connections unless they are marked as a primary tunnel. Only one tunnel can be marked primary, which means if another tunnel is designated for untrusted Wifi, the active tunnel will not automatically switch from the Ethernet tunnel to this one during a connection to an untrusted Wifi network: because untrusted Wifi is also only a global toggle, and the untrusted Wifi tunnel is not marked primary; and so the Ethernet tunnel will be used on untrusted Wifi connections as well. There is currently no other way to assign the untrusted Wifi tunnel to the untrusted networks while keeping the Ethernet tunnel as is
  • Additionally if the untrusted Wifi toggle is disabled in the main settings tab, now, either no tunnel will automatically be switched on, or the tunnel(s) will automatically turn off, for those networks; same applies vice versa with the global Ethernet toggle
  • The issues demonstrated in the above scenario will only amplify when using tunnels simultaneously in kernel mode is incorporated in the WG Tunnel app

Describe the solution you'd like In the settings tab of the main UI, the Auto-tunneling section should be reduced to only one toggle (with the exception of restart on ping fail). When that toggle is turned on, the Auto-tunneling section in the tunnel editing UI will now take effect, with the following toggles at the user's disposal for the tunnel(s):

  • for untrusted, unmetered Wifi
  • for untrusted, metered Wifi
  • for trusted Wifi names
  • for mobile data
  • for ethernet

Likewise, if the one auto-tunneling toggle is turned off in the main settings tab, the auto-tunneling section will be greyed out in each tunnel, as they will not take effect

Although, as only one tunnel can be enabled at a time in VPN mode, this does present a necessary restriction: if one tunnel has an auto-tunnel toggle on for mobile data, ethernet or untrusted Wifi, those same toggles must be greyed out on other tunnels to avoid auto-tunnel conflict between the tunnels. Theoretically, when able to use more than one tunnel simultaneously in kernel mode, this restriction will be nonexistent.

Describe alternatives you've considered

Additional context This should allow a cleaner, simpler interface of auto-tunneling overall, more specific use case options, and more control over auto-tunneling for each tunnel instead of globally (especially with untrusted Wifi and ethernet). This will be particularly very handy when using tunnels simultaneously in kernel mode is incorporated (hopefully soon, because WireGuard has had that for quite a while now)

Dondrejohnson5 avatar Jul 25 '24 20:07 Dondrejohnson5