本文摘自PHP中文网,作者藏色散人,侵删。
下面由centos基础教程栏目给大家介绍CentOS7防火墙设置,希望对需要的朋友有所帮助!1.查看系统版本
在设置防火墙的时候,首先查看linux系统版本。
centOS7 系统没有此命令
1 2 | cat /etc/redhat-release(/etc/centos-release)
输出:CentOS Linux release 7.4.1708 (Core)
|
此命令对于CentOS6和CentOS7都可以使用。linux系统中etc文件夹主要用于存放一些配置文件。
2.防火墙相关命令
1 2 3 4 | 启动: systemctl start firewalld
查看状态: systemctl status firewalld
禁止开机启动: systemctl disable firewalld
关闭服务: systemctl stop firewalld 关闭
|
3.systemctl命令
systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。使用方法如下:
1 2 3 4 5 6 7 8 9 | 启动一个服务: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防火墙设置的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
centos关闭防火墙命令是什么
Linux中如何运行shell程序
Linux怎么安装unzip
Linux如何查看内存?
Linux如何解压文件
Linux的root用户是什么?
存放Linux基本命令的是什么目录
怎样查看Linux中docker镜像文件
Linux vps是什么意思?
Linux通过端口转发来实现访问内网服务的图文步骤详解
更多相关阅读请进入《Linux》频道 >>
转载请注明出处:木庄网络博客 » 详解CentOS7防火墙设置