配置linux防火墙

因为防火墙不让我们访问8080和8081端口,我们处理的方案有两种:

第一种:在防火墙允许访问的端口中增加8080和8081端口

配置linux防火墙

      添加完端口后,重启防火墙,如下所示。

[html] view plain copy
  1. [[email protected] ~]# service iptables restart  
  2. iptables:将链设置为政策 ACCEPT:filter                    [确定]  
  3. iptables:清除防火墙规则:                                 [确定]  
  4. iptables:正在卸载模块:                                   [确定]  
  5. iptables:应用防火墙规则:                                 [确定]  
  6. [[email protected] ~]#  
第二种:为了方便,我们直接关闭防火墙并且设置开机也不启动。service iptables stop是关闭防火墙,chkconfig iptables off是禁止开机自启动,chkconfig iptables --list是查看七种情况还没有开机自启的情况,如果都是"关闭"状态,说明已经都禁止开机自启动了。

[html] view plain copy
  1. [[email protected] ~]# service iptables stop  
  2. iptables:将链设置为政策 ACCEPT:filter                    [确定]  
  3. iptables:清除防火墙规则:                                 [确定]  
  4. iptables:正在卸载模块:                                   [确定]  
  5. [[email protected] ~]# chkconfig iptables off  
  6. [[email protected] ~]# chkconfig iptables --list  
  7. iptables        0:关闭    1:关闭    2:关闭    3:关闭    4:关闭    5:关闭    6:关闭  
  8. [[email protected] ~]#