最近遇到一个郁闷的问题。好几天都没解决,求助,谢谢大家。

打算开放一个端口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 解决

centos下添加的端口不能访问(防火墙关闭)的更多相关文章

  1. centos下apache安装后无法访问

    2013.11.28遇到的问题: -------------------------------------- 一.centos下apache安装后无法访问 得查一下防火墙的问题 iptables添加 ...

  2. 嵌入式环境:CentOS下添加用户并且让用户获得root权限

    CentOS下添加用户并且让用户获得root权限 http://www.centoscn.com/CentOS/config/2014/0810/3471.html 1.添加用户,首先用adduser ...

  3. Centos 下添加开机自启动服务和脚本【转】

    最近刚玩Centos7的系统,跟Centos6还是很多方面有改变的,这里记录一下怎么在Centos7下添加开机自启动脚本和服务的方法. 1.添加开机自启服务 我这里以docker 服务为例,设置如下两 ...

  4. 配置基于centos下的远程Jupyter Notebook访问

    最近在学习一些服务器上的操作,学着熟悉Liunx系统,记录下自己踩过的坑吧 1.开机后更新系统: yum -y upgrade yum - y update 2.查看已安装的应用 yum list 3 ...

  5. Centos 下添加开机自启动服务和脚本

    最近刚玩Centos7的系统,跟Centos6还是很多方面有改变的,这里记录一下怎么在Centos7下添加开机自启动脚本和服务的方法. 1.添加开机自启服务 我这里以docker 服务为例,设置如下两 ...

  6. linux(centos 7)下安装elasticsearch - head插件(端口占用,防火墙关闭)

    本文章来自网络仅供个人学习记录之用 一:安装Git(如果未安装) 1, yum install git 2, git --version #查看版本 二:安装node(如果未安装) node安装 三: ...

  7. CentOS firewall添加开放端口

    添加 firewall-cmd --zone=public --add-port=80/tcp --permanent (–permanent永久生效,没有此参数重启后失效) 重新载入 firewal ...

  8. centos下添加epel源

    RHEL以及他的衍生发行版如CentOS.Scientific Linux为了稳定,官方的rpm repository提供的rpm包往往是很滞后的,当然了,这样做这是无可厚非的,毕竟这是服务器版本,安 ...

  9. Centos下添加PHP对MSSQL的支持

    Leave a reply 其实很少会有连接SQL Server的机会,不过我们公司刚好有个应用需要使用的SQL Server的数据库,所以也知道给LNMP安装MSSQL的扩展. 搜索网上的相关文章一 ...

随机推荐

  1. 解决ul显示不在div中的问题

    css样式 #banner { padding: 0px; } #banner ul { list-style: none; margin: 0px; padding: 0px; text-align ...

  2. HDU 3030 - Increasing Speed Limits

    Problem Description You were driving along a highway when you got caught by the road police for spee ...

  3. [string]Reverse Words in a String

    Given an input string, reverse the string word by word. For example,Given s = "the sky is blue& ...

  4. 鼠标聚焦到Text输入框时,按回车键刷新页面原因及解决方法

    前提 一个form中只有一个输入框,当输入框获取焦点后,点击回车,导致整个页面都刷新,问题解决办法. 1.处理form  在form中添加事件 <form onsubmit="retu ...

  5. Ubuntu 使用wget 命令下载JDK

    wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-co ...

  6. HTML特殊符号编码大全

    HTML特殊字符编码:往网页中输入特殊字符,需在html代码中加入以&开头的字母组合或以&#开头的数字.下面就是以字母或数字表示的特殊符号大全. ´ ´ © © > > µ ...

  7. 识别Json字符串并分隔成Map集合

    识别Json字符串并分隔成Map集合 前言: 最近又看了点Java的知识,于是想着把CYQ.Data V5迁移到Java版本. 过程发现坑很多,理论上看大部分很相似,实践上代码写起来发现大部分都要重新 ...

  8. 算法分析-leedcode正则题目

    Implement regular expression matching with support for '.' and '*'. 首先这里有个可能大家不知道的地方: if p[0] = '*', ...

  9. JNDI(转载)

    转自:http://javacrazyer.iteye.com/blog/759485 原理:         在DataSource中事先建立多个数据库连接,保存在数据库连接池中.当程序访问数据库时 ...

  10. MFC使用Windows media player播放声音文件

    一.在需要播放声音的资源上添加控件 资源视图  . 选择添加控件的资源(如对话框).右键单击.插入ActiveX控件.调整你需要的控件属性并记录ID 二.在项目中添加播放声音的类 点击菜单中的项目.添 ...