在CentOS7中,有很多CentOS 6中的常用服务发生了变化
其中iptables是其中比较大的一个。防火墙iptables被firewalld取代
centOS 7防火墙命令
查看防火墙状态。
systemctl status firewalld
临时关闭防火墙命令。重启电脑后,防火墙自动起来。
systemctl stop firewalld
永久关闭防火墙命令。重启后,防火墙不会自动启动。
systemctl disable firewalld
打开防火墙命令。
systemctl enable firewalld
centOS 6关闭防火墙
#可以查看到iptables服务的当前状态
service iptables status
#关于启动和关闭防火墙的命令:
1) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
网友评论