Linux command
wg-quick 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Bring up a WireGuard tunnel
sudo wg-quick up [wg0]
Tear down a WireGuard tunnel
sudo wg-quick down [wg0]
Bring up a tunnel from a specific config file
sudo wg-quick up [/etc/wireguard/wg0.conf]
Save current interface state to config
sudo wg-quick save [wg0]
说明
wg-quick is a convenience wrapper for setting up WireGuard VPN tunnels quickly. It reads configuration files from /etc/wireguard/ and handles interface creation, routing, and DNS configuration automatically. Configuration files are named interface.conf (e.g., /etc/wireguard/wg0.conf) and contain both WireGuard settings and wg-quick-specific options like Address, DNS, and routing rules.
参数
- up _interface_
- Bring up a WireGuard interface using config file
- down _interface_
- Tear down a WireGuard interface
- save _interface_
- Save current configuration to config file
- strip _interface_
- Output configuration without wg-quick-specific options
FAQ
What is the wg-quick command used for?
wg-quick is a convenience wrapper for setting up WireGuard VPN tunnels quickly. It reads configuration files from /etc/wireguard/ and handles interface creation, routing, and DNS configuration automatically. Configuration files are named interface.conf (e.g., /etc/wireguard/wg0.conf) and contain both WireGuard settings and wg-quick-specific options like Address, DNS, and routing rules.
How do I run a basic wg-quick example?
Run `sudo wg-quick up [wg0]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does up _interface_ do in wg-quick?
Bring up a WireGuard interface using config file