naggie / dsnet

FAST command to manage a centralised wireguard VPN. Think wg-quick but quicker: key generation + address allocation.

Home Page:https://calbryant.uk/blog/how-to-set-up-a-wireguard-vpn-in-minutes-with-dsnet/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Launch at boot ?

Write opened this issue · comments

Hi,

I discovered this tools on HN and decided to move all my current config on it.
Everything is working great and smooth. Unfortunately my old /etc/wireguard/wg0.conf is up and running at boot, how can i set it to launch 'dsnet up' at boot instead ?

Thanks.

Assuming you're using a wq-quick with systemctl integration, this will stop the wg0 interface from starting at boot:

sudo systemctl stop wg-quick@wg0
sudo systemctl disable wg-quick@wg0

To make the dsnet interface come back up at boot, you need to add a systemd unit file. Here's one that you could put in /etc/systemd/system/dsnet.service

[Unit]
Description=dsnet
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/dsnet up

[Install]
WantedBy=default.target

After that, sudo systemctl daemon-reload to get systemd to see it, then sudo systemctl enable dsnet to start it at boot.

I haven't tested it yet. I'll do that later today.
I'll update the docs with this, and perhaps make dsnet do this automatically in another release.

Thanks, it work great !
Have a great day

Excellent, you're welcome. I've added the now known-working file to etc/ and updated the FAQ on the readme.