配置文件内容 | [Interface]
PrivateKey =
ListenPort =
[Peer]
PublicKey =
AllowedIPs =
Endpoint =
PersistentKeepalive =
| [Interface]
PrivateKey =
ListenPort =
[Peer]
PublicKey =
AllowedIPs =
Endpoint =
PersistentKeepalive =
| [Interface]
PrivateKey =
ListenPort =
Address =
[Peer]
PublicKey =
AllowedIPs =
Endpoint =
PersistentKeepalive =
|
运行步骤 | insmod ./wireguard.ko
ip link add dev wg0 type wireguard
ip -4 addr add dev wg0 20.0.0.2/24
./wg setconf wg0 ./wg0.conf
ip link set dev wg0 up
| ./wireguard-go -f wg0 &
ip -4 addr add dev wg0 20.0.0.2/24
./wg setconf wg0 ./wg0.conf &
ip link set dev wg0 up
| ./tunsafe start -d -n wg0 ./wg0.conf &
|
停止 | ip link del dev wg0
rmmod wireguard.ko
| ip link del dev wg0 | ./tunsafe stop wg0 |
遇到的问题 | 死机重启:与内核不兼容,请下载对应cpu型号的模块,或者改用Tunsafe
| 严重丢包:检查./wireguard-go wg0 & 中是否加上 “-f”,在前台运行 | 一段时间后自动断开: 配置文件里加上“PersistentKeepalive = 25”
|