Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of checking whether the firewall is turned on under linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail the method of checking whether the firewall is turned on under linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Linux method to check whether the firewall is turned on: first use the "ifconfig" or "ip addr" command to check the IP; of the linux host, and then use the "service iptables status" command to see if the firewall is turned on.

Linux to see if the firewall enables and deletes iptables rules.

Preparatory work

First confirm IP

For testing later, let's first confirm the IP of the linux host. You can view it using ifconfig or ip addr.

Check that the system listens for open ports and netstat confirms. As we can see, port 143 is open.

Whether the firewall is enabled or not, how to check whether the firewall is up and running. Use service iptables status to check centos6.

The centos7 system iptables is called firewalld. Use systemctl status firewalld to see if it is started. As shown in the figure, it is already running

Restart the firewall service since the current release of centos7 is the mainstream, the firewall usage of centos7 will be introduced in the following sections. Restarting and shutting down the firewall service will not be prompted unless an error is reported.

View iptables rules if you want to see the rules currently running by iptables, use iptables-L to list them.

As shown in this column, my linux host port 143firewall is open to the public.

Through the same network segment computer to test whether the firewall is OK, telnet linux host IP 143,

Delete iptables rules if you delete the iptables rule, you can test and see that port 143is dead. The order is

Firewall-cmd-zone= public-remove-port=143/tcp-permanent

Check the port number allowed by the firewall to enter the command firewall-cmd-- zone=public-- list-ports to view the port number outside the firewall column of the computer in the external network, which can be deleted specifically. If you want to undelete the iptables rule, you can simply stop or disable the firewalld service.

This is the end of this article on "how to check whether the firewall is turned on under linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report