- 安装 WireGuard 客户端
brew install wireguard-tools
- 配置 WireGuard 客户端
sudo mkdir /usr/local/etc/wiregurad
sudo touch /usr/local/etc/wiregurad/wg0.conf
wg0.conf 文件如下:
[Interface]
Address = 10.200.200.2/32
PrivateKey = <client_private_key>
MTU = 1420
[Peer]
PublicKey = <server_public_key>
Endpoint = <SERVER_IP:SERVER_PORT>
AllowedIPs = 10.200.0.0/16
PersistentKeepalive = 25
- 启动 WireGuard
sudo wg-quick up wg0-client
sudo wg show