Detailed explanation of the basic use of centos7 firewall in linux

Detailed explanation of the basic use of centos7 firewall in linux

1. Basic use of firewalld

start up:

systemctl start firewalld

Check the status:

systemctl status firewalld

stop:

systemctl disable firewalld

Disable:

systemctl stop firewalld

2.systemctl is the main tool in CentOS7's service management tools, which integrates the functions of the previous service and chkconfig.

Start the firewall:

systemctl start firewalld.service

Turn off the firewall:

systemctl stop firewalld.service

Restart the firewall:

systemctl restart firewalld.service

Display the status of the firewall:

systemctl status firewalld.service

Firewall at boot time:

systemctl enable firewalld.service

To disable the firewall at boot:

systemctl disable firewalld.service

Check whether the firewall is started:

systemctl is-enabled firewalld.service

View the list of started services:

systemctl list-unit-files|grep enabled

View the list of services that failed to start:

systemctl --failed

3. Configure firewalld-cmd

View version:

firewall-cmd --version

View Help:

firewall-cmd --help

Display status:

firewall-cmd --state

View all open ports:

firewall-cmd --zone=public --list-ports

Update firewall rules:

firewall-cmd --reload

View region information:

firewall-cmd --get-active-zones

Check the area to which the specified interface belongs:

firewall-cmd --get-zone-of-interface=eth0

Deny all packets:

firewall-cmd --panic-on

To cancel the rejected status:

firewall-cmd --panic-off

Check if rejected:

firewall-cmd --query-panic

4: Open the port

Add to

firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent is effective permanently, and will become invalid after restart without this parameter) #Open port 80

Reload

firewall-cmd --reload

Check

firewall-cmd --zone=public --query-port=80/tcp #Check if port 80 is open

delete

firewall-cmd --zone= public --remove-port=80/tcp --permanent #Delete port 80 configuration

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of the basic commands of Firewalld firewall in Centos7
  • A brief introduction to the simple use of CentOS7 firewall and open ports
  • Centos7 (Firewall) firewall opens common port commands
  • Simple configuration tutorial of CentOS7 Docker firewall
  • How to disable the default firewall and enable iptables firewall in CentOS 7.0
  • Summary of common commands of firewall in centos 7
  • Complete list of CentOS7 firewall operation commands

<<:  Example code of vue + element ui to realize player function

>>:  Install mysql offline using rpm under centos 6.4

Recommend

Implementation of docker-compose deployment project based on MySQL8

1. First, create the corresponding folder accordi...

Detailed tutorial on installing Docker and docker-compose suite on Windows

Table of contents Introduction Download and insta...

Nginx high concurrency optimization practice

1. Necessity of Tuning​ I have always been reluct...

SQL Optimization Tutorial: IN and RANGE Queries

Preface "High Performance MySQL" mentio...

Implementation of react automatic construction routing

Table of contents sequence 1. Centralized routing...

Native javascript+CSS to achieve the effect of carousel

This article uses javascript+CSS to implement the...

getdata table table data join mysql method

public function json_product_list($where, $order)...

Introduction to the method attribute of the Form form in HTML

1 method is a property that specifies how data is ...

Introduction to installing JDK under Linux, including uninstalling OpenJDK

1. View openjdk rpm -qa|grep jdk 2. Delete openjd...

Sample code for realizing book page turning effect using css3

Key Takeaways: 1. Mastering CSS3 3D animation 2. ...

Set IE8 to use IE7 style code

<meta http-equiv="x-ua-compatible" co...

Common JavaScript memory errors and solutions

Table of contents 1. Timer monitoring 2. Event mo...

Methods and problems encountered in installing mariadb in centos under mysql

Delete the previously installed mariadb 1. Use rp...

Parameters to make iframe transparent

<iframe src="./ads_top_tian.html" all...