大网数据广告活动
服务器运维问答

Wireguard client communication without peer key via 1 router server

· 52CE 我爱测

I have this setup: ---server 1 config--- [Interface] Address = 10.200.200.1/24 ListenPort = 6666 PrivateKey = server_private_key [Peer] PublicKey = client1_public_key AllowedIPs = 10.200.200.2/32 PersistentKeepalive = 21 [Peer] P…

问题原文

原帖链接 · William Taylor · CC BY-SA 4.0

I have this setup:

---server 1 config---

[Interface]
Address = 10.200.200.1/24
ListenPort = 6666
PrivateKey = server_private_key

[Peer]
PublicKey = client1_public_key
AllowedIPs = 10.200.200.2/32
PersistentKeepalive = 21

[Peer]
PublicKey = client2_public_key
AllowedIPs = 10.200.200.4/32
PersistentKeepalive = 21

--- client 1 config---

[Interface]
Address = 10.200.200.2/24
PrivateKey = client1_private_key
DNS = 10.200.200.1

[Peer]
PublicKey = server_public_key
Endpoint = server_ip:6666
AllowedIPs = 10.200.200.1/32
PersistentKeepalive = 21

--- client 2 config---

[Interface]
Address = 10.200.200.4/24
PrivateKey = client2_private_key
DNS = 10.200.200.1

[Peer]
PublicKey = server_public_key
Endpoint = server_ip:6666
AllowedIPs = 10.200.200.1/32
PersistentKeepalive = 21

I can ping server from client1 and client2, but i can't ping client1 from client2 and client2 from client1.

Is there a way for client1 ping client2 without adding client2 key to client1 config, since this will make addding client much harder. For example, if i add 1 new client when having 5 clients, all of the config must be changed.

已采纳解答

原帖链接 · Justin Ludwig · CC BY-SA 4.0

If you change the AllowedIPs setting of your client configs to AllowedIPs = 10.200.200.0/24, all the clients' traffic to the 10.200.200.0/24 block will be routed through their WireGuard connection to the server. This will allow you to connect from one client to another using their WireGuard addresses -- eg ping 10.200.200.4 to ping client2 from client1.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-01-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。