Last active
November 14, 2022 14:12
-
-
Save fouwels/8e9f06e4213a551405f31e6470164fce to your computer and use it in GitHub Desktop.
wireguard interface systemd "service"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Initialise and load wireguard interface %i | |
After=network.target | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/sbin/ip link add %i type wireguard | |
ExecStart=/sbin/ip addr add 10.200.1.100/24 dev %i | |
ExecStart=/usr/bin/wg setconf %i /etc/wireguard/%i.conf | |
ExecStart=/sbin/ip link set dev %i up | |
ExecStopPost=/sbin/ip link del %i | |
ExecReload=/usr/bin/wg setconf %i /etc/wireguard/%i.conf | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment