How to check the status of Linux firewall 1. Basic Operations # View the firewall status service iptables status # Stop the firewall service iptables stop # Start the firewall service iptables start # Restart the firewall service iptables restart # Permanently turn off the firewall chkconfig iptables off # Permanently shut down and restart chkconfig iptables on 2. Open port 80 vim /etc/sysconfig/iptables # Add the following code -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT Save and exit and restart the firewall service iptables restart 2. Firewall 1. Check the firewall service status systemctl status firewalld If Active: active (running) is highlighted, it means it is in the startup state. Active: inactive (dead) in gray means stop, you can also look at the words. 2. Check the status of the firewall firewall-cmd --state 3. Start, restart, or shut down firewalld.service # Enable service firewalld start# Restart service firewalld restart# Disable service firewalld stop 4. Check firewall rules firewall-cmd --list-all 5. Query, open, and close ports # Check whether the port is open firewall-cmd --query-port=8080/tcp # Open port 80 firewall-cmd --permanent --add-port=80/tcp # Remove port firewall-cmd --permanent --remove-port=8080/tcp #Restart the firewall (restart the firewall after modifying the configuration) firewall-cmd --reload Parameter Explanation 1. Firewall-cmd: It is a tool provided by Linux to operate firewall; 2. --permanent: indicates that it is set to be persistent; 3. --add-port: identifies the added port; This is the end of this article about examples of methods to check the status of the Linux firewall. For more relevant content on checking the status of the Linux firewall, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: MySQL 5.7.27 installation and configuration method graphic tutorial
>>: The problem of Vue+tsx using slot is not replaced
Problem Peeping In the server, assuming that the ...
The solution to forgetting the initial password o...
Since I need to learn how to build servers and da...
When nginx receives a request, it will first matc...
1. Official Introduction grep is a commonly used ...
1. Summary: In general, they can be divided into ...
Prepare a CentOS6 installation disk (any version)...
First download the zip archive version from the o...
Preface At work, I need to count the materials su...
1. Packaging Vue project Enter the following name...
Table of contents Preface What is metadata Refere...
How to deploy Oracle using Docker on Mac First in...
This article example shares the specific code of ...
The following error occurred while installing the...
This question is very strange, so I will go strai...