1.0 KiB
tags
| tags | |||
|---|---|---|---|
|
WireGuard Activation Script (wg-up.sh)
This script initializes and activates the configured WireGuard tunnel using wg-quick. Always ensure you have appropriate network permissions (sudo) to run this.
Execution Steps
To bring the WireGuard interface online, execute the following command in a privileged shell session:
sudo wg-quick up wg0
Verification
After running this script, verify the connection status and IP assignment using:
- Check Tunnel Status:
wg show - Verify Connectivity: Attempt to ping an internal service endpoint.
[!NOTE] Modernized Workflow While using
sudo wg-quick up wg0is functional, for system-level automation or service management (e.g., in Docker/Kubernetes), it is best practice to define a corresponding systemd unit file. This ensures the connection attempts to start automatically on boot and can be managed viasystemctl status, providing robust logging and dependency handling beyond simple script execution.