Skip to content

Instantly share code, notes, and snippets.

@dvigne
Created September 6, 2022 05:58
Show Gist options
  • Save dvigne/0f2fc1f673fd7199bb3fbddbd474bcd5 to your computer and use it in GitHub Desktop.
Save dvigne/0f2fc1f673fd7199bb3fbddbd474bcd5 to your computer and use it in GitHub Desktop.
Basic Wireguard systemd Unit File Configuration
[Unit]
Description=Wireguard VPN Server
Documentation=man:wg
After=network.target auditd.service
[Service]
ExecStartPre=/bin/bash /etc/wireguard/ifup
ExecStart=bash -c "/usr/bin/wg setconf wg0 /etc/wireguard/wg0.conf && /usr/sbin/ip link set up dev wg0"
ExecStopPost=/bin/bash /etc/wireguard/ifdown
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Alias=wireguard.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment