
现在搭好了一个 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 2023-06-20 22:23:31 +08:00 我有私钥、公钥给你,你有私钥、公钥给我。 |
2 shimc 2023-06-20 22:41:18 +08:00 客户端:用客户端私钥、服务端公钥 |
3 233373 wireguard 不分服务端客户端 |
4 ysc3839 2023-06-20 22:47:11 +08:00 客户端配置文件里的 PublicKey 填 PubKeyA ,服务端要添加 Peer ,PublicKey 填客户端的公钥 |
5 LxnChan OP |
7 wheat0r 2023-06-20 23:07:46 +08:00 wireguard 其实是个站到站 vpn |
8 itechify PRO 偶遇泠泫凝大佬 |
9 GoodRui 2023-06-20 23:48:07 +08:00 via Android @wheat0r 大佬,之前用过一段时间 wg ,连接还行,就是用户多了应该怎么管理?还有就是能不能方便的做细粒度的访问控制呢? |
12 ricwangcom 2023-06-21 09:14:25 +08:00 为啥不直接用 open VPN ? |
13 LxnChan OP |