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

Vue sample code for easily implementing virtual scrolling

Table of contents Preface Rolling principle accom...

Vue directives v-html and v-text

Table of contents 1. v-text text rendering instru...

JavaScript Dom implements the principle and example of carousel

If we want to make a carousel, we must first unde...

Creation, constraints and deletion of foreign keys in MySQL

Preface After MySQL version 3.23.44, InnoDB engin...

CSS3 realizes the animation of shuttle starry sky

Result: html <canvas id="starfield"&...

Some points on using standard HTML codes in web page creation

<br />The most common mistake made by many w...

Mysql database index interview questions (basic programmer skills)

Table of contents introduction Indexing principle...

Vue two-choice tab bar switching new approach

Problem Description When we are working on a proj...

Mysql 5.7.19 free installation version encountered pitfalls (collection)

1. Download the 64-bit zip file from the official...

Detailed explanation of the difference between in and exists in MySQL

1. Prepare in Advance For your convenience, I cre...

MySQL database migration quickly exports and imports large amounts of data

Database migration is a problem we often encounte...

Recommended plugins and usage examples for vue unit testing

Table of contents frame First-class error reporti...

Solution to forgetting mysql password under linux

The problem is as follows: I entered the command ...