Help Center
Autostart WireGuard in systemd
These steps are mostly distribution agnostic and have been tested on Debian unstable and Fedora.
-
Generate a valid and working WireGuard configuration file
/etc/wireguard/wg0.conf
. Our setup guide offers details.Note: You may have to replace the Endpoint hostname with the WireGuard server IP address in the WireGuard configuration file. DNS may or may not be applied when systemd brings the wg0 interface up. -
Add the WireGuard service to systemd:
sudo systemctl enable wg-quick@wg0.service sudo systemctl daemon-reload
-
Start the new service immediately:
sudo systemctl start wg-quick@wg0
-
Reboot your computer system to verify the automatic connection on startup works as expected.
-
Check the service status:
systemctl status wg-quick@wg0
-
To remove the service and clean up the system:
sudo systemctl stop wg-quick@wg0 sudo systemctl disable wg-quick@wg0.service sudo rm -i /etc/systemd/system/wg-quick@wg0* sudo systemctl daemon-reload sudo systemctl reset-failed
Related Articles
- AVC denial with selinux
- How do I prevent VPN leaks using iptables?
- Cannot import .ovpn config file
- Building the IVPN CLI Client for Linux on a Raspberry Pi
- IVPN on Qubes OS
Still have questions?
Get in touch and we'll get back to you in a few hours.
Contact supportInterested in privacy?
Read our latest privacy news and keep up-to-date on IVPN services.
Visit IVPN Blog