【问题标题】:No internet for connected clients with freshly install pivpn (wireguard)新安装的 pivpn (wireguard) 连接的客户端没有互联网
【发布时间】:2021-01-13 10:30:27
【问题描述】:

我有一个新安装的 pi4,在运行 curl -L https://install.pivpn.io | bash 安装 pivpn (wireguard) 后,客户端连接但无法访问互联网。 从我的 Pi 我可以 ping 客户端。使用 tcpdump 我也可以看到客户端已连接,但仍然无法访问互联网

我的 Iptables 是这样设置的:

#iptables -S
 
-P INPUT DROP
-P FORWARD DROP
-P OUTPUT ACCEPT
-A INPUT -i eth0 -p udp -m udp --dport 51820 -m comment --comment wireguard-input-rule -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -m comment --comment ssh -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 443 -m comment --comment ssh -j ACCEPT
-A FORWARD -d 10.6.0.0/24 -i eth0 -o wg0 -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment wireguard-forward-rule -j ACCEPT
-A FORWARD -s 10.6.0.0/24 -i wg0 -o eth0 -m comment --comment wireguard-forward-rule -j ACCEPT

在我的 /etc/sysctl.conf 中 net.ipv4.ip_forward=1

ipvpn的其余设置都是标准的。

在wireguard设置中我只使用google DNS:8.8.8.8

我的想法不多了。 有人可以帮忙吗?

【问题讨论】:

    标签: server vpn raspberry-pi4 wireguard


    【解决方案1】:

    听起来你唯一缺少的是IP Forwarding

    您可以通过以下方式即时启用它:sysctl -w net.ipv4.ip_forward=1

    您可以通过编辑/etc/sysctl.conf 并将其设置为永久 net.ipv4.ip_forward = 1

    【讨论】:

      猜你喜欢
      • 2020-11-26
      • 2022-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-05
      • 2022-01-17
      相关资源
      最近更新 更多