WireGuard 服务器似乎没有转发到 Internet 的连接。
我尝试在我的计算机和服务器上从头开始重新安装 Wireguard,但问题仍然存在。
当我
sudo wg-quick up wg0-client
时,我得到:
[#] wg setconf wg0-client /dev/fd/63
[#] ip address add 10.200.200.2/32 dev wg0-client
[#] ip link set mtu 1420 up dev wg0-client
[#] resolvconf -a tun.wg0-client -m 0 -x
Too few arguments.
Too few arguments.
[#] wg set wg0-client fwmark 51820
[#] ip -4 route add 0.0.0.0/0 dev wg0-client table 51820
[#] ip -4 rule add not fwmark 51820 table 51820
[#] ip -4 rule add table main suppress_prefixlength 0
这是我的/etc/wireguard/wg0.conf(在我的服务器上)...
[Interface]
Address = 10.200.200.1/24
SaveConfig = true
PrivateKey = server_private_key
ListenPort = 51820
[Peer]
PublicKey = client_public_key
AllowedIPs = 10.200.200.2/32
...和我的/etc/wireguard/wg0-client.conf(在我的机器上):
[Interface]
Address = 10.200.200.2/32
PrivateKey = client_private_key
DNS = 10.200.200.1
[Peer]
PublicKey = server_public_key
Endpoint = server_address:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 21
我猜
-4
和Too few arguments
这几行可能是问题的关键,但我对这类事情知之甚少,无法自己解决。当然我没有忘记在我的服务器上wg-quick up wg0
Too few arguments
只是一个警告,我遇到了同样的问题并且连接没问题。有人说这是 resolvconf
中的一个问题 a resolvconf bug.
您可以使用 wireguard 脚本中的脚本再次尝试.
确保您也使用文本编辑器创建以下文件: vim /etc/sysctl.d/10-wireguard.conf
添加以下文字: `
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
Reload all changes and turn on NAT routing:
sysctl -p /etc/sysctl.d/10-wireguard.conf
systemctl restart [email protected]
`