wireguard - Wireguard VPN 不接收来自服务器的数据
问题描述
我将wireguard服务器和客户端配置如下:
服务器:
[Interface]
PrivateKey = <server private key>
Address = 192.168.2.4
ListenPort = 51821
[Peer]
PublicKey = <client public key>
AllowedIPs = 172.20.10.5/32
客户:
[Interface]
PrivateKey = <client private key>
Address = 172.20.10.5
[Peer]
PublicKey = <server public key>
AllowedIPs = 192.168.2.4/32
Endpoint = <Public IP>:51821
PersistentKeepalive = 25
当我启动它们时,我的客户端无法 ping 服务器网络中的任何机器。在浏览器中,该 ip 仍然是客户端的互联网 IP。当我wg
在客户端上运行时,它显示发送了一些数据,而在传输信息中收到了 0 个数据。
我的配置有什么明显的错误吗?如果没有,常见的故障排除方法是什么?
解决方案
也许尝试:
服务器:
[Interface]
PrivateKey = <server private key>
Address = 10.200.200.1/24
ListenPort = 51821
[Peer]
PublicKey = <client public key>
AllowedIPs = 10.200.200.2/32
客户:
[Interface]
PrivateKey = <client private key>
Address = 10.200.200.2/32
[Peer]
PublicKey = <server public key>
AllowedIPs = 10.200.200.1/24
Endpoint = <Public IP>:51821
PersistentKeepalive = 25
我没有尝试过 AllowedIPs 选项,所以我不能保证它会起作用。我可以通过删除这些行来保证它可以工作。但希望你已经弄清楚了自己!
如果有帮助,我已经做了一个教程:https ://github.com/agavrel/wireguard_cloud
推荐阅读
- c++ - 将节点添加到链表而不显式分配内存空间(不使用新的)
- javascript - Switch 语句未返回所需的值
- html - 在css Grid中向包装器添加填充会导致水平滚动
- c++ - 找不到用户定义的 getline。自动扣款有问题?
- php - 如何修复“类 App\Http\Controllers\Productcontroller 不存在”
- python - 将“,”附加到整数列表中的每个项目
- python - 在 windows python 3.6 上安装 tensorflow
- excel - 在 Excel 中计数数据以计算交叉点的概率
- ruby-on-rails - 在 Rails 中使用删除按钮传递参数
- jetty - 为什么嵌入式 Jetty 示例执行 server.dump(System.err)?