wireguard之wg-quick使用
wg-quick 是 WireGuard 的一个便捷脚本,用于快速配置和管理 WireGuard VPN 连接。它简化了手动配置网络接口和 WireGuard 的过程。
用法
wg-quick cmd help
➜ ~ wg-quick
Usage:
wg-quick [ up | down | save | strip ] [ CONFIG_FILE | INTERFACE ]
CONFIG_FILE is a configuration file, whose filename is the interface name
followed by `.conf'. Otherwise, INTERFACE is an interface name, with
configuration found at:
/etc/wireguard/INTERFACE.conf /usr/local/etc/wireguard/INTERFACE.conf.
It is to be readable by wg(8)'s `setconf' sub-command, with the exception
of the following additions to the [Interface] section, which are handled
by wg-quick:
- Address: may be specified one or more times and contains one or more
IP addresses (with an optional CIDR mask) to be set for the interface.
- DNS: an optional DNS server to use while the device is up.
- MTU: an optional MTU for the interface; if unspecified, auto-calculated.
- Table: an optional routing table to which routes will be added; if
unspecified or `auto', the default table is used. If `off', no routes
are added. Besides `auto' and `off', only `main' is supported on
this platform.
- PreUp, PostUp, PreDown, PostDown: script snippets which will be executed
by bash(1) at the corresponding phases of the link, most commonly used
to configure DNS. The string `%i' is expanded to INTERFACE.
- SaveConfig: if set to `true', the configuration is saved from the current
state of the interface upon shutdown.
See wg-quick(8) for more info and examples.

