一、服务器重启有时候需要关闭防火墙在启动其他的服务,记录下最常用的防火墙命令:

linux:版本CentOs7

第一种:service方式的命令:

1:查看防火状态:

[root@localhost ~]# service iptables status

2:开启防火墙:

[root@localhost ~]# service iptables start

3:关闭防火墙:

[root@localhost ~]# service iptables stop

第二种:iptables 方式的命令:

可以进入 /etc/init.d/文件夹下,不进去也可以:

1、查看防火墙状态

[root@localhost init.d]#  /etc/init.d/iptables status

2、关闭防火墙

[root@sugon2 init.d]#  /etc/init.d/iptables stop

3、重启防火墙

[root@sugon2 init.d]#  /etc/init.d/iptables restart

更多推荐

Linux关闭防火墙命令