Detailed explanation of CentOS7 firewall settings

藏色散人
Release: 2020-11-24 15:19:56
forward
3452 people have browsed it

The following column centos basic tutorial will introduce CentOS7 firewall settings to you. I hope it will be helpful to friends in need!

Detailed explanation of CentOS7 firewall settings

1. Check the system version

When setting up the firewall, first check the Linux system version.

lsb_release -a
Copy after login

centOS7 system does not have this command

cat /etc/redhat-release(/etc/centos-release)
输出:CentOS Linux release 7.4.1708 (Core)
Copy after login

This command can be used for both CentOS6 and CentOS7. The etc folder in the Linux system is mainly used to store some configuration files.

2. Firewall related commands

启动: systemctl start firewalld
查看状态: systemctl status firewalld 
禁止开机启动: systemctl disable firewalld  
关闭服务: systemctl stop firewalld 关闭
Copy after login

3.systemctl command

systemctl is the main tool in the service management tool of CentOS7. It integrates the functions of the previous service and chkconfig. . The usage method is as follows:

启动一个服务: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
Copy after login

Note: CentOS7 and the following versions use iptables to serve the firewall.

The above is the detailed content of Detailed explanation of CentOS7 firewall settings. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!