如何在 ubuntu 上打开特定的 tcp 端口

如何在 ubuntu 上打开特定的 tcp 端口

我在 Ubuntu 18.04 上,我正在尝试运行 python -m http.server 8080 并且一切正常,我可以从其他计算机连接到服务器,但如果我将端口更改为: python -m http.server 8501 我无法连接到服务器......

我尝试ufw通过sudo ufw disable允许端口 8501 来禁用它,但没有用,我试过了netstat,它说系统正在监听,0.0.0.0:8501 我试过了iptables没有发现任何可疑的东西......

7    ACCEPT     udp  --  anywhere             anywhere             udp spt:8501
8    ACCEPT     udp  --  anywhere             anywhere             udp dpt:8501
9    ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:8501
10   ACCEPT     tcp  --  anywhere             anywhere             tcp spt:8501

我可以在本地卷曲 127.0.0.1:8501。

是否有任何特殊设置不允许外部访问该端口?

相关内容