<div dir="ltr"><div dir="ltr">On Thu, Mar 11, 2021 at 12:01 PM Reindl Harald <<a href="mailto:h.reindl@thelounge.net" target="_blank">h.reindl@thelounge.net</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
Am 11.03.21 um 06:36 schrieb Amish:<br>
> Hello<br>
> <br>
> So I have a wireguard setup which I use to connect to my server.<br>
> <br>
> But I do not connect to it daily, just once a in a while.<br>
> <br>
> I have setup wg0.netdev file and wg0.network file and all is working fine.<br>
> <br>
> But how do I set it up such that interface wg0 does not connect <br>
> automatically but comes up only when I run:<br>
> <br>
> #networkctl up wg0<br>
> <br>
> Effectively I want wireguard to connect/disconnect on demand<br>
<br>
given that wireguard runs directly in the kernel and has no single <br>
userland process what problem would you like to solve and why?<br></blockquote><div><br></div><div>It might be the problem that I also have, which is that you don't always want certain destinations to be *permanently* routed through the tunnel -- e.g. you might have a VPN for <a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a> ::/0 (the whole internet) but don't actually want it to be active all the time, only when the need for it occurs.</div><div><br></div><div>For example I have a tunnel through a USA server for websites that block Europe -- it routes 0/0 because I don't know the "wanted" destinations in advance, but at the same time I don't want the system to *default* to sending all my traffic halfway around the world and back, so it has to be "on demand".</div><div><br></div><div>People are in a hurry to suggest "openvpn is meh, use wg-quick" and then the same people suggest "wg-quick is meh, use networkd" forgetting that A and C don't necessarily intersect.</div></div><div><br></div>-- <br><div dir="ltr"><div dir="ltr">Mantas Mikulėnas</div></div></div>