WireGuard

WireGuard 配置与维护命令。

12 / 12

安装

命令
apt install wireguard nftables

WireGuard 2

命令
cd /etc/wireguard

WireGuard 3

命令
umask 077

WireGuard 4

命令
wg genkey | tee server_private.key | wg pubkey > server_public.key

WireGuard 5

命令
nano wg0.conf

WireGuard 6

WireGuard 7

命令
sudo wg-quick up wg0

WireGuard 8

命令
sudo systemctl enable wg-quick@wg0.service

WireGuard 9

命令
sudo sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf

WireGuard 10

命令
sudo sed -i 's/#net.ipv6.conf.all.forwarding=1/net.ipv6.conf.all.forwarding=1/' /etc/sysctl.conf

WireGuard 11

命令
sudo sysctl -p

客户端脚本

命令
apt install qrencode
命令
nano wg-client-manage.sh