配置linux防火墙

xiaoxiao2021-02-28  126

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

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

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

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

[html]  view plain  copy [root@node-js ~]# service iptables stop   iptables:将链设置为政策 ACCEPT:filter                    [确定]   iptables:清除防火墙规则:                                 [确定]   iptables:正在卸载模块:                                   [确定]   [root@node-js ~]# chkconfig iptables off   [root@node-js ~]# chkconfig iptables --list   iptables        0:关闭    1:关闭    2:关闭    3:关闭    4:关闭    5:关闭    6:关闭   [root@node-js ~]#   
转载请注明原文地址: https://www.6miu.com/read-66778.html

最新回复(0)