【发布时间】:2017-03-16 15:32:17
【问题描述】:
我将我的 linux 设置为访问点,然后在端口 3000 上运行打印“hello world”的简单网络服务器。
并成功连接到我的智能手机。
在 linux 终端中,http://localhost:3000 运行良好。
但在智能手机中,
如果我访问http://172.24.1.105:3000,则无法连接到它。 (172.24...是ap的ip)
chrome的错误信息是
无法访问此站点。 172.24.1.105 拒绝连接
我搜索了 Google (https://serverfault.com/questions/725262/what-causes-the-connection-refused-message),我怀疑 linux 的防火墙。
pi@raspberrypi:~/prj/ap_server $ sudo tcpdump -n icmp
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
... when I access to port 3000,
15:07:13.102750 IP 192.168.0.3 > 168.126.63.2: ICMP 192.168.0.3 udp port 42531 unreachable, length 386
日志在上面。所以我无法访问 ap 的网络服务器。
所以我想知道两件事......
1.如何禁用其端口块?
2。在tcpdump日志中,我访问的是3000端口,为什么日志打印端口是42531?
加号)
即使我输入sudo service iptables stop,问题也没有解决
sudo netstat -ntlp | grep 3000日志:
**tcp6 0 0 :::3000 :::* LISTEN 1999/nodejs**
+我按照本教程进行操作-> https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/ .
还有 ipv4 设置。
【问题讨论】:
-
这是一个很好的例子,说明了为什么您不应该重写错误消息。 “无法到达”和“连接被拒绝”之间存在天壤之别。
-
@EJP 你是什么意思..?无法连接,连接被拒绝...我只是从 chrome 消息中获取的
-
我说的是 Chrome 消息。如果无法访问该站点,则它不可能拒绝连接。一种或另一种发生了。不是都。 Chrome 不应该重写错误消息。它刚刚引起了混乱。
标签: linux networking port tcp-ip access-point