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

Analysis of linux to check the status of firewalls and ports open to the outside world

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

Share

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

1. View firewall status

View firewall status systemctl status firewalld

Turn on firewall systemctl start firewalld

Turn off Firewall systemctl stop firewalld

Turn on firewall service firewalld start

If you can't open it.

First use: systemctl unmask firewalld.service

Then: systemctl start firewalld.service

two。 View the status of ports open to the outside world

Query the open port netstat-ntulp | grep port number: you can view a specific port number.

Query whether the specified port has firewall-cmd enabled-- query-port=666/tcp

The prompt yes indicates that it is enabled, and no indicates that 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 specified ports that need to be open: firewall-cmd-- add-port=123/tcp-- permanent

Reload the added port: firewall-cmd-- reload

Query whether the specified port is enabled successfully: firewall-cmd-- query-port=123/tcp

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

Summary

The above is the linux that the editor introduced to you to check the status of the firewall and the port status that is open to the outside world. I hope it will be helpful to everyone!

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: 302

*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