How to check if the firewall is running in centos7

WBOY
Release: 2022-04-29 10:33:04
Original
41041 people have browsed it

View method: 1. Use systemctl to view, this command is used to manage the system, the syntax is "systemctl status firewalld"; 2. Use firewall to view, you can view the default status of the firewall, the syntax is "firewall-cmd - -state".

How to check if the firewall is running in centos7

The operating environment of this article: centos 7 system, Dell G3 computer.

How to check whether the firewall is running in centos7

Method 1: systemctl status firewalld

Commands to open, close and disable the firewall

(1) Set the firewall to be enabled at startup: systemctl enable firewalld.service

(2) Set the firewall to be disabled at startup: systemctl disable firewalld.service

(3) Start the firewall: systemctl start firewalld

(4) Turn off the firewall: systemctl stop firewalld

(5) Check the firewall status: systemctl status firewalld

The example is as follows:

How to check if the firewall is running in centos7

Method 2: firewall-cmd --state

View the default firewall status (notrunning is displayed after closing, running is displayed after opening)

systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
Copy after login

Recommended tutorial: "centos tutorial

The above is the detailed content of How to check if the firewall is running in centos7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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