小编cha*_*ase的帖子

可以ping但不能连接(curl、wget、apt-get等)(rasberry pi服务器)

背景:我正在尝试设置一个 rasberry pi 服务器。一切都很顺利,我的 pi 可以 apt-get update 等,直到我让端口转发工作并且 ssh 在 LAN 之外工作。我也一直在尝试启动网页,因此我为 80 以外的端口创建了一个端口转发,因为我的 ISP 阻止了它。

问题:通过局域网外的 ssh 访问 pi 后,我无法使用 apt-get 或通过我的 pi 连接到网站。尽管如此,ping 仍然运行良好。

我尝试过的:我尝试了许多不同的 iptables 配置,以及完全刷新它并使用人们建议的配置重新开始几次。它似乎都不起作用。目前,iptables 已完全刷新。

这是 pings 和 wget/curls 的示例输出:

pi@raspberrypi:~$ sudo apt-get update
0% [Connecting to mirrordirector.raspbian.org (5.153.225.207)] [Connecting to w^Cpi@raspberrypi:~$ wget -q -O- google.com
^C
pi@raspberrypi:~$ ping google.com
PING google.com (74.125.224.98) 56(84) bytes of data.
64 bytes from lax02s19-in-f2.1e100.net (74.125.224.98): icmp_req=1 ttl=52 time=58.8 ms
64 bytes from lax02s19-in-f2.1e100.net (74.125.224.98): icmp_req=2 ttl=52 time=53.8 …
Run Code Online (Sandbox Code Playgroud)

networking linux ssh wget iptables

8
推荐指数
1
解决办法
2万
查看次数

标签 统计

iptables ×1

linux ×1

networking ×1

ssh ×1

wget ×1