A brief analysis of Linux to check the firewall status and the status of the ports open to the outside world

A brief analysis of Linux to check the firewall status and the status of the ports open to the outside world

1. Check the firewall status

Check the firewall status systemctl status firewalld

Start the firewall systemctl start firewalld

Disable the firewall systemctl stop firewalld

Start the firewall service firewalld start

If you cannot open

First use: systemctl unmask firewalld.service

Then: systemctl start firewalld.service

2. Check the status of open ports

Query the open ports netstat -ntulp | grep port number: You can check a specific port number

Check whether the specified port is open firewall-cmd --query-port=666/tcp

If the prompt is yes, it means it is enabled; if the prompt is no, it means it is not enabled.

3. External development port

Check whether the port you want to open is open: firewall-cmd --query-port=6379/tcp

Add the specified port to be opened: firewall-cmd --add-port=123/tcp --permanent

Reload the added port: firewall-cmd --reload

Check whether the specified port is opened successfully: firewall-cmd --query-port=123/tcp

Remove the specified port: firewall-cmd --permanent --remove-port=123/tcp

Summarize

The above is my introduction to checking the firewall status and the status of open ports in Linux. I hope it will be helpful to you!

You may also be interested in:
  • Linux firewall status check method example
  • How to configure Linux firewall and open ports 80 and 3306
  • How to modify firewall configuration in Linux system
  • How to use firewall iptables strategy to forward ports on Linux servers
  • How to check if the firewall is turned off in Linux

<<:  Detailed explanation of MySQL cursor concepts and usage

>>:  Node.js uses express-fileupload middleware to upload files

Recommend

Implementation of Mysql User Rights Management

1. Introduction to MySQL permissions There are 4 ...

centos7.2 offline installation mysql5.7.18.tar.gz

Because of network isolation, MySQL cannot be ins...

Vue implements left and right sliding effect example code

Preface The effect problems used in personal actu...

Analysis of the principle of using PDO to prevent SQL injection

Preface This article uses pdo's preprocessing...

js method to realize shopping cart calculation

This article example shares the specific code of ...

Detailed explanation of the use of MySQL select cache mechanism

MySQL Query Cache is on by default. To some exten...

How to install and use Server-U 14 version

Introducing Server-U software Server-U is a very ...

How to locate MySQL slow queries

Preface I believe that everyone has had experienc...

Solution to the long delay of MySQL database master-slave replication

Preface The delay of MySQL master-slave replicati...

react+antd.3x implements ip input box

This article shares the specific code of react+an...

How to install and connect Navicat in MySQL 8.0.20 and what to pay attention to

Things to note 1. First, you need to create a my....

A brief discussion on how to choose and combine div and table

Page layout has always been my concern since I st...

MySQL derived table (Derived Table) simple usage example analysis

This article uses an example to describe the simp...