日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

centos下添加的端口不能访问(防火墙关闭)

發布時間:2025/5/22 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 centos下添加的端口不能访问(防火墙关闭) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

最近遇到一個郁悶的問題。好幾天都沒解決,求助,謝謝大家。

打算開放一個端口15900。可是無論怎么設置防火墻,或者干脆關閉防火墻。就是不能被外部機器訪問(在同一內網網段機器)。

本機訪問沒有問題(127.0.0.1)。防火墻配置應該也沒有問題。

iptables status:

復制內容到剪貼板
代碼:
Chain INPUT (policy ACCEPT)??
target? ???prot opt source? ?? ?? ?? ?? ?destination? ?? ?? ???
ACCEPT? ???all??--??anywhere? ?? ?? ?? ? anywhere? ?? ?? ?? ?state RELATED,ESTABLISHED? ?
ACCEPT? ???icmp --??anywhere? ?? ?? ?? ? anywhere? ?? ?? ?? ???
ACCEPT? ???all??--??anywhere? ?? ?? ?? ? anywhere? ?? ?? ?? ???
ACCEPT? ???tcp??--??anywhere? ?? ?? ?? ? anywhere? ?? ?? ?? ?state NEW tcp dpt:ftp? ?
ACCEPT? ???tcp??--??anywhere? ?? ?? ?? ? anywhere? ?? ?? ?? ?state NEW tcp dpt:ssh? ?
ACCEPT? ???tcp??--??anywhere? ?? ?? ?? ? anywhere? ?? ?? ?? ?state NEW tcp dpt:http? ?
ACCEPT? ???tcp??--??anywhere? ?? ?? ?? ? anywhere? ?? ?? ?? ?state NEW tcp dpt:15900? ?
REJECT? ???all??--??anywhere? ?? ?? ?? ? anywhere? ?? ?? ?? ?reject-with icmp-host-prohibited? ?
??
Chain FORWARD (policy ACCEPT)??
target? ???prot opt source? ?? ?? ?? ?? ?destination? ?? ?? ???
REJECT? ???all??--??anywhere? ?? ?? ?? ? anywhere? ?? ?? ?? ?reject-with icmp-host-prohibited? ?
??
Chain OUTPUT (policy ACCEPT)??
target? ???prot opt source? ?? ?? ?? ?? ?destination? ???

輸入lsof -i 顯示如下信息。

復制內容到剪貼板
代碼:
ntpd? ?? ?1640? ???ntp? ?21u??IPv4??13492? ?? ?0t0??UDP 192.168.2.111:ntp? ?
? ? master? ? 1720? ? root? ?12u??IPv4??13709? ?? ?0t0??TCP localhost.localdomain:smtp (LISTEN)??
? ? httpd? ???1730? ? root? ? 4u??IPv6??13843? ?? ?0t0??TCP *:http (LISTEN)??
? ? httpd? ???1737??apache? ? 4u??IPv6??13843? ?? ?0t0??TCP *:http (LISTEN)??
? ? httpd? ???1738??apache? ? 4u??IPv6??13843? ?? ?0t0??TCP *:http (LISTEN)??
? ? httpd? ???1739??apache? ? 4u??IPv6??13843? ?? ?0t0??TCP *:http (LISTEN)??
? ? httpd? ???1740??apache? ? 4u??IPv6??13843? ?? ?0t0??TCP *:http (LISTEN)??
? ? httpd? ???1741??apache? ? 4u??IPv6??13843? ?? ?0t0??TCP *:http (LISTEN)??
? ? httpd? ???1742??apache? ? 4u??IPv6??13843? ?? ?0t0??TCP *:http (LISTEN)??
? ? httpd? ???1743??apache? ? 4u??IPv6??13843? ?? ?0t0??TCP *:http (LISTEN)??
? ? httpd? ???1744??apache? ? 4u??IPv6??13843? ?? ?0t0??TCP *:http (LISTEN)??
? ? Xvnc? ?? ?1776? ? root? ? 4u??IPv4??14282? ?? ?0t0??TCP localhost.localdomain:15900 (LISTEN)??
? ? clock-app 2111? ? root? ?21u??IPv4??26309? ?? ?0t0??TCP 192.168.2.111:48606->65.113.31.147:http (CLOSE_WAIT)??
? ? sshd? ?? ?2281? ? root? ? 3r??IPv4??20572? ?? ?0t0??TCP 192.168.2.111:ssh->192.168.2.61:57678 (ESTABLISHED)??

192.168.2.111是當機IP

可以看出來,80端口,21,22都沒問題。但就是自己后來添加上來的端口不能訪問。是沒有與服務綁定么?

關鍵這句“localhost.localdomain:15900 (LISTEN)??”

防火墻關閉,SElinux關閉還是不能解決問題

?

?

解決!VNC配置問題。居然沒看清楚。郁悶。。。

復制內容到剪貼板
代碼:
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 800x600 -nolisten tcp -localhost"

問題出在localhost,刪掉-nolisten tcp -localhost 解決

轉載于:https://www.cnblogs.com/lcword/p/5289088.html

總結

以上是生活随笔為你收集整理的centos下添加的端口不能访问(防火墙关闭)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。