详解CentOS7防火墙设定
发布时间:12/01 来源:未知 浏览:
关键词:
1.查看系统版本
在设定防火墙的时候,第一查看linux系统版本。
lsb_release -a
centOS7 系统没有此命令
cat /etc/redhat-release(/etc/centos-release) 输出:CentOS Linux release 7.4.1708 (Core)
此命令关于CentOS6和CentOS7都可以使用。linux系统中etc文件夹主要用于存置一些配置文件。
2.防火墙相关命令
启动: systemctl start firewalld 查看状态: systemctl status firewalld 制止开机启动: systemctl disable firewalld 关闭效劳: systemctl stop firewalld 关闭
3.systemctl命令
systemctl是CentOS7的效劳治理工具中主要的工具,它融合此前service和chkconfig的功效于一体。使用办法如下:
启动一个效劳:systemctl start firewalld.service 关闭一个效劳:systemctl stop firewalld.service 重新启动一个效劳:systemctl restart firewalld.service 显示一个效劳的状态:systemctl status firewalld.service 在开机时启用一个效劳:systemctl enable firewalld.service 在开机时禁用一个效劳:systemctl disable firewalld.service 查看效劳可否开机启动:systemctl is-enabled firewalld.service 查看已启动的效劳列表:systemctl list-unit-files|grep enabled 查看启动失败的效劳列表:systemctl --failed
留意:CentOS7 以下版本是用iptables为防火墙效劳的。
以上就是详解CentOS7防火墙设定的具体内容,更多请关注百分百源码网其它相关文章!