如何使用 systemd (wg-quick) 自动启动 Wireguard

如果你添加了 wg-quick 配置,例如 /etc/wireguard/wg0.conf,你可以使用 systemd 启用系统启动时自动启动它:

enable_wg_quick.sh
sudo systemctl enable --now wg-quick@wg0

如果你之前使用此配置手动启动了 Wireguard,你需要先关闭它,否则 systemd 将无法启动它!


Check out similar posts by category: Networking, Systemd, Wireguard