我在服务器和客户端都使用了 ubuntu 20.04,并在服务器上使用了 EC2 AWS 实例。我还使用此安装程序在 AWS 上安装 wireguard:
https://github.com/pprometey/wireguard_aws
所以我很确定没有错误,我尝试了 /24 和 /32 子网,但都无济于事。我还将 MTU 设置为 1360,因为它使一些无法通过的工作变得有效,在尝试了许多不同的 MTU 后,它终于在手机上正常工作了。
有人知道如何解决这个问题吗?我没有办法了……
(服务器)
[Interface]
Address = 10.50.0.1
SaveConfig = false
PrivateKey = (hidden)
ListenPort = (hidden)
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip link set dev wg0 mtu 1360; ip link set dev eth0 mtu 1360;
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
[Peer]
PublicKey = (hidden)
PresharedKey = (hidden)
AllowedIPs = 10.50.0.2/32
[Peer]
PublicKey = (hidden)
PresharedKey = (hidden)
AllowedIPs = 10.50.0.3/24
===================================
(客户)
[Interface]
PrivateKey = (hidden)
Address = 10.50.0.3/24
DNS = 94.140.14.14,94.140.15.15
PostUp = ip link set dev wg0 mtu 1360; ip link set dev eth0 mtu 1360; ip link set dev wlan0 mtu 1360;
MTU = 1360
[Peer]
PublicKey = (hidden)
PresharedKey = (hidden)
AllowedIPs = 0.0.0.0/0
Endpoint = (hidden)
PersistentKeepalive=25