Wireguard 连接成功但未连接到互联网

Wireguard 连接成功但未连接到互联网

我所在的公司给了我两个 WireGuard 配置文件。我在我的 Android 手机上设置了一个,它运行良好,在我的 Ubuntu 上设置了另一个。它曾经工作了一两天;但突然停止工作了。在此期间,我可能弄乱了我的网络设置,我不确定。它连接到 WireGuard VPN 服务器;但是,当我尝试使用互联网时,我没有数据。我甚至无法 ping 通任何地方。

我在手机上测试了两个 WireGuard 配置,以确保它们都能正常工作。

我甚至在我的 Ubuntu 上虚拟安装了 Windows,并在 Windows 中使用了我的 WireGuard 配置,并且它运行正常。

我使用 Ubuntu 20.04 LTS,这是我的 WireGuard 客户端配置:

[Interface]
PrivateKey = <PRIVATE-KEY>
Address = 10.19.49.26/24 ,fd9d:bc11:4021::1a/48
DNS =  172.26.11.122, fd00::a:b7a 

[Peer]
PublicKey = <PUBLIC-KEY>
PresharedKey = <PRESHARED-KEY>
AllowedIPs = 0.0.0.0/0,::/0
Endpoint = <WIREGUARD-SERVER>:51820

运行输出:

$ sudo wg-quick up wg2

是:

Warning: `/etc/wireguard/wg2.conf' is world accessible
[#] ip link add wg2 type wireguard
[#] wg setconf wg2 /dev/fd/63
[#] ip -4 address add 10.19.49.26/24 dev wg2
[#] ip -6 address add fd9d:bc11:4021::1a/48 dev wg2
[#] ip link set mtu 1420 up dev wg2
[#] resolvconf -a wg2 -m 0 -x
[#] wg set wg2 fwmark 51820
[#] ip -6 route add ::/0 dev wg2 table 51820
[#] ip -6 rule add not fwmark 51820 table 51820
[#] ip -6 rule add table main suppress_prefixlength 0
[#] ip6tables-restore -n
[#] ip -4 route add 0.0.0.0/0 dev wg2 table 51820
[#] ip -4 rule add not fwmark 51820 table 51820
[#] ip -4 rule add table main suppress_prefixlength 0
[#] sysctl -q net.ipv4.conf.all.src_valid_mark=1
[#] iptables-restore -n

相关内容