CentOS 7.0默认使用的是firewall作为防火墙
一、防火墙的开启、关闭、禁用命令
(1)设置开机启用防火墙:systemctl enable firewalld.service
(2)设置开机禁用防火墙:systemctl disable firewalld.service
(3)启动防火墙:systemctl start firewalld
(4)关闭防火墙:systemctl stop firewalld
(5)检查防火墙状态:systemctl status firewalld
查看防火墙状态
firewall-cmd --state
not running (没有起动)
方法:手动启动它
systemctl start firewalld //启动服务
又出错:
Failed to start firewalld.service: Unit is masked. firewalld
服务被锁定了
方法: systemctl unmask firewalld
systemctl status firewalld //查看是否启动成功
停止firewall
systemctl stop firewalld.service
禁止firewall开机启动
systemctl disable firewalld.service