centos下添加的端口不能访问(防火墙关闭)
生活随笔
收集整理的這篇文章主要介紹了
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下添加的端口不能访问(防火墙关闭)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: NOIP2012普及组 (四年后的)解题
- 下一篇: 巡航车是什么意思?