我试图让其他计算机访问我的本地服务器,但是我在本地尝试过<#>I不能在本地访问它,甚至我自己也不能访问它。
有几件事你应该知道:
通过http://172.26.141.106:5201/访问我的服务器
我可以通过以下两种方式访问我的服务器:
ifconfig | grep inet
结果
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet addr:172.26.141.106 Bcast:172.26.141.255 Mask:255.255.255.0
inet6 addr: fe80::f767:cd56:9641:d3a9/64 Scope:Link
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
cat /etc/hosts
的输出:
127.0.0.1 localhost.localdomain localhost
127.0.0.1 hearen.pc
127.0.0.1 hearen-OptiPlex-7050
127.0.0.1 staging
127.0.0.1 arthas
172.26.141.106 localhost hearen.pc
$ sudo ufw disable
Firewall stopped and disabled on system startup
$ sudo ufw status
Status: inactive
有什么办法我错过了吗?我只想让其他人通过http://172.26.141.106:5201/访问我的服务器
(如有任何帮助,将不胜感激:)
在@Ed的帮助下,我通过sudo lsof -i -P -n | grep LISTEN | grep 5201
检查端口,只有127.0.0.1
被监听。
问题解决后,我配置了我的角服务器侦听0.0.0.0
。
发布于 2019-01-10 04:12:16
检查您的服务器是否正在侦听:
sudo lsof -n | grep TCP | grep LISTEN
您也可以使用nc检查路由。在服务器上启动nc,监听未使用的端口,然后从另一台计算机连接--这将验证iptables和路由是否正确。
我猜你只是在收听本地主机。
发布于 2020-02-20 00:37:16
我以下列方式解决了这一问题:
https://askubuntu.com/questions/1108468
复制相似问题