略微加速

略速 - 互联网笔记

Linux防火墙iptables开启和关闭

2020-10-12 leiting (3281阅读)

标签 运维 Linux

查看iptables规则的话,就用iptables -L这个命令就好了~~,ok

清除iptables规则的话,用iptables -F ,that's aaaaalllllll~~

关闭,可以有两种命令,一种是敲击 /etc/init.d/iptables stop   另一种是 services iptables stop ,ok

11.png

看到了吧,上面就是两个命令的使用。

 

然后我们在执行一些chkconfig,看看 六个状态下的命令开启设置,因为这个是涉及到重启以后是否你修改的命令~~

12.png

是吧,七个状态 还记得么,关机的时候敲init 0,状态那里0的一列全是关闭。

那chkconfig iptables off(设置自动启动为关闭)

chkconfig iptables on(设置自动启动为启动)

chkconfig --del iptables(移除开启自启动)

chkconfig --add iptables(增加开启自启动)


北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3