日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

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

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

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

打算開放一個(gè)端口15900。可是無論怎么設(shè)置防火墻,或者干脆關(guān)閉防火墻。就是不能被外部機(jī)器訪問(在同一內(nèi)網(wǎng)網(wǎng)段機(jī)器)。

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

iptables status:

復(fù)制內(nèi)容到剪貼板
代碼:
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 顯示如下信息。

復(fù)制內(nè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是當(dāng)機(jī)IP

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

關(guān)鍵這句“l(fā)ocalhost.localdomain:15900 (LISTEN)??”

防火墻關(guān)閉,SElinux關(guān)閉還是不能解決問題

?

?

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

復(fù)制內(nèi)容到剪貼板
代碼:
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 800x600 -nolisten tcp -localhost"

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

轉(zhuǎn)載于:https://www.cnblogs.com/lcword/p/5289088.html

總結(jié)

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

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。