在服务器上,运行 Ubuntu 22.04
sudo netstat -tnlp | grep :4000
tcp 0 0 0.0.0.0:4000 0.0.0.0:* LISTEN 10690/nxd
tcp6 0 0 :::4000 :::* LISTEN 10690/nxd
服务响应 HTTP 请求:
curl localhost:4000
curl: (52) Empty reply from server
ufw 已禁用
sudo ufw status
Status: inactive
从客户端(同一子网)计算机:
nc -zv 192.168.1.111 4000
nc: connect to 192.168.1.111 port 4000 (tcp) failed: No route to host
SSH 已启用
nc -zv 192.168.1.111 22
Connection to 192.168.1.111 22 port [tcp/ssh] succeeded!
平作品:
ping 192.168.1.111
PING 192.168.1.111 (192.168.1.111) 56(84) bytes of data.
64 bytes from 192.168.1.111: icmp_seq=1 ttl=64 time=309 ms
我没有足够的代表来发表评论 - 所以必须给出答案......
您已检查“ufw”,但您可能配置了不同的防火墙。尝试以下操作:
如果状态已启用(“正在运行”),您可以使用以下命令添加端口 4000: