服务器使用 systemd 自动启动 wireguard
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