小编Hea*_*ren的帖子

localhost 和 127.0.0.1 可以通过 IP 地址访问本地服务器

我试图让其他计算机访问我的本地服务器,但我在本地尝试过,即使我自己也无法在本地访问它

你应该知道的几件事:

我的目标

通过http://172.26.141.106:5201/访问我的服务器

我现在能做什么

我可以通过以下两种方式访问​​我的服务器:

IP配置

的结果 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
Run Code Online (Sandbox Code Playgroud)

主机

的输出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
Run Code Online (Sandbox Code Playgroud)

防火墙

$ sudo ufw disable
Firewall stopped and disabled on system startup
$ sudo ufw status
Status: inactive
Run Code Online (Sandbox Code Playgroud)

有什么办法让我错过了吗?我想要的只是让其他人通过http://172.26.141.106:5201/访问我的服务器

任何帮助将不胜感激 :)

2019-01-10 …

firewall hosts localhost 16.04

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

标签 统计

16.04 ×1

firewall ×1

hosts ×1

localhost ×1