本文摘自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防火墙设置的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
Linux下如何创建txt文件
Linux重启网络命令是什么
关于Linux下如何创建共享文件夹的实例详解
Linux中bash是什么意思?
Linux下分区容量不足了如何进行扩容
Linux ecs 自动迁移工具的详解
Linux中程序调试的方法有哪些
Linux 如何查看版本
Linux中使用useradd命令添加用户后无法登录
Linux负载查看用什么命令?
更多相关阅读请进入《Linux》频道 >>
转载请注明出处:木庄网络博客 » 详解CentOS7防火墙设置