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

An example of the method of checking the status of linux Firewall

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

Share

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

The method of checking the status of linux Firewall

1. Basic operation

# View Firewall status service iptables status# stop Firewall service iptables stop# start Firewall service iptables start# restart Firewall service iptables restart# permanently close Firewall chkconfig iptables off# permanently shut down restart chkconfig iptables on

2. Open port 80

Vim / etc/sysconfig/iptables# adds 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# and disable service firewalld stop

4. View firewall rules

Firewall-cmd-list-all

5. Query, open and close the port

# query whether the port is open for 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 firewall (restart firewall after configuration modification) firewall-cmd-- reload

Parameter interpretation

1. Firwall-cmd: a tool for operating firewall provided by Linux

2.-- permanent: set to persistent

3.-- add-port: identifies the added port

This is the end of this article on the linux firewall status view method examples, more related to the linux firewall status view content, please search the previous articles or continue to browse the following related articles hope that you will support more in the future!

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