I successfully configured wireguard on my nixos, but i have one question, how can i enable/disable my vpn without rebuilding my configuration?
you can stop the wireguard service with systemctl. I think in your case, if you called your VPN configuration “seekrit-tunnle” for example, you can do systemctl stop wireguard-seekrit-tunnle
and it should be turned off. You can turn it back on with systemctl start wireguard-seekrit-tunnle
. If that’s the wrong unit name, check systemctl
and see if there’s a unit with wireguard in its name, and run those commands on it.
sudo wg-quick up/down interface_name
Thanks! That’s what I want
No need to wait 2 days, answer is here