In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces linux how to check the firewall status, the article is very detailed, has a certain reference value, interested friends must read it!
Linux check firewall status: 1, iptables firewall, check firewall status, code is [service iptables status]; 2, firewall firewall, code is [firewall-cmd-- state].
How linux can view the status of the firewall:
1. Iptables Firewall
1. Basic operation
# View 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
# restart after permanent shutdown
Chkconfig iptables on
2. Open port 80
Vim / etc/sysconfig/iptables
# add the following code
-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 80-j ACCEPT
Restart the firewall after saving exit
Service iptables restart
II. Firewall Firewall
1. View the status of firewall service
Systemctl status firewalld
When Active: active (running) is highlighted, it indicates that it is in the starting state.
The appearance of Active: inactive (dead) gray indicates stop, or look at the word.
2. Check the status of firewall
Firewall-cmd-state
3. Enable, restart, shut down, and firewalld.service services
# enable
Service firewalld start
# restart
Service firewalld restart
# close
Service firewalld stop
4. View firewall rules
Firewall-cmd-list-all
5. Query, open and close the port
# query 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 changing the configuration)
Firewall-cmd-reload
Parameter interpretation
1. Firwall-cmd: a tool for operating firewall provided by Linux
2. Permanent: set to persistent
3. Add-port: identify the added port
The above is all the contents of the article "how to check the Firewall status of linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.