现在搭好了一个 Wireguard 的服务端,这里姑且称为 ServerA 。ServerA 上生成了一对 PublicKey 和 PrivateKey ,这里称为 PubKeyA 和 PrivKeyA 。
[Interface]
Address = 10.0.0.1/24
SaveConfig = true
ListenPort = 51820
PrivateKey = PrivKeyA
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
interface: wg0
public key: PubKeyA
private key: (hidden)
listening port: 51820
[Interface]
PrivateKey =
Address = 10.0.0.1/24
[Peer]
PublicKey =
AllowedIPs = 0.0.0.0/0
Endpoint = myserver.cn:51820
这个时候 Windows 端的 Wireguard 会自动生成一组公钥私钥,那么在客户端的配置文件中应该用哪个公钥和哪个私钥呢 1
listenfree 350 天前
我有私钥、公钥给你,你有私钥、公钥给我。
|
2
shimc 350 天前
客户端:用客户端私钥、服务端公钥
|
3
233373 350 天前
wireguard 不分服务端客户端
|
4
ysc3839 350 天前
客户端配置文件里的 PublicKey 填 PubKeyA ,服务端要添加 Peer ,PublicKey 填客户端的公钥
|
5
LxnChan OP |
7
wheat0r 350 天前
wireguard 其实是个站到站 vpn
|
8
oneisall8955 350 天前 via Android
偶遇泠泫凝大佬
|
12
ricwangcom 350 天前
为啥不直接用 open VPN ?
|
13
LxnChan OP |