我将我的 linux 设置为接入点,然后运行简单的网络服务器,在端口 3000 上打印“hello world”。
并将其与我的智能手机成功连接。
在linux终端中,http://localhost:3000
效果很好。
但在智能手机中,
如果我访问http://172.24.1.105:3000
,则无法连接到它。(172.24... 是 ap 的 ip)
chrome的错误信息是
无法访问此站点。172.24.1.105 拒绝连接
我搜索了谷歌(https://serverfault.com/questions/725262/what-c auses-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 设置。