hl15

1.首先出现这种情况肯定是你的阿里云防火墙被打开了

2.查看端口是否可访问:telnet ip 端口号 (如本机的35465:telnet localhost 35465)

3.开放的端口位于/etc/sysconfig/iptables中

4.查看时通过 more /etc/sysconfig/iptables 命令查看

4.如果想开放端口(如:8002)

(1)通过vi /etc/sysconfig/iptables 进入编辑增添一条-A INPUT -p tcp -m tcp --dport 8002-j ACCEPT 即可

(2)执行 /etc/init.d/iptables restart 命令将iptables服务重启

#(3)保存 /etc/rc.d/init.d/iptables save

注:如若不想修改iptables表,可以直接输入下面命令:

# iptables -I INPUT -p tcp --dport 8002 -j ACCEPT

原因:在新安装的linux系统中,防火墙默认是被禁掉的,一般也没有配置过任何防火墙的策略,所有不存在/etc/sysconfig/iptables文件。

解决:

  1. 在控制台使用iptables命令随便写一条防火墙规则,如:iptables -P OUTPUT ACCEPT
  2. 使用service iptables save进行保存,默认就保存到了/etc/sysconfig目录下的iptables文件中

 

分类:

技术点:

相关文章:

  • 2021-12-22
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2022-01-19
  • 2021-06-24
  • 2021-05-13
  • 2021-11-23
猜你喜欢
  • 2022-12-23
  • 2022-01-05
  • 2021-11-12
  • 2021-12-03
  • 2021-04-08
  • 2021-08-21
相关资源
相似解决方案