@
rainABC 例子:
### 服务器端配置
```
# /etc/wireguard/wg0.conf
[Interface]
PrivateKey = PrivateKey
Address = 10.0.0.1/24
ListenPort = 51820
# packet forwarding
PreUp = sysctl -w net.ipv4.ip_forward=1
# packet masquerading
PreUp = iptables -t nat -A POSTROUTING -o wg0 -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -o wg0 -j MASQUERADE
# remote client
[Peer]
PublicKey = PublicKey
AllowedIPs = 10.0.0.2
PersistentKeepalive = 25
```
### 客户端配置
```
# /etc/wireguard/wg0.conf
[Interface]
PrivateKey = PrivateKey
Address = 10.0.0.2/32
# relay server
[Peer]
PublicKey = PublicKey
Endpoint = serverIP:51820
AllowedIPs = 10.0.0.0/24, OpenVPN CIDR
PersistentKeepalive = 25
```
自行替换成对的 PrivateKey 和 PublicKey ,serverIP ,OpenVPN CIDR