linux中某个端口拒绝远程主机连接原因及解决方法
linux中某个端口拒绝远程主机连接原因及解决方法
问题描述:- 一个是被防火墙拦截
- 或者该端口的监听地址为本机(127.0.0.1),如果这样的话,只有从本机发起的对端口的访问被允许,而外部主机访问被拒绝。可以通过“netstat -anp | grep 9000”命令查看该端口的监听地址:
有上图可知,9000端口监听的地址为本地地址(127.0.0.1)(Not all processes could be identified, non-owned process infowill not be shown, you would have to be root to see it all.)tcp 0 0 ::ffff:127.0.0.1:9000 :::* LISTEN 6614/javatcp 0 0 ::ffff:127.0.0.1:46722 ::ffff:127.0.0.1:9000 TIME_WAIT -tcp 0 0 ::ffff:127.0.0.1:46729 ::ffff:127.0.0.1:9000 TIME_WAIT -tcp 0 0 ::ffff:127.0.0.1:46723 ::ffff:127.0.0.1:9000 ESTABLISHED 6733/javatcp 0 0 ::ffff:127.0.0.1:46726 ::ffff:127.0.0.1:9000 TIME_WAIT -tcp 0 0 ::ffff:127.0.0.1:46730 ::ffff:127.0.0.1:9000 ESTABLISHED 6976/javatcp 0 0 ::ffff:127.0.0.1:9000 ::ffff:127.0.0.1:46730 ESTABLISHED 6614/javatcp 0 0 ::ffff:127.0.0.1:9000 ::ffff:127.0.0.1:46723 ESTABLISHED 6614/java
- 如果防火墙过滤了访问该端口的请求则设置过滤规则,放行该端口或者关闭防火墙
- 如果监听地址为本机地址则修改其监听地址为真是ip地址(如192.168.8.119)。
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。