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

How to turn off and turn on iptables and firewalld firewalls by centos, Red Hat and Ubuntu

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

In this issue, the editor will bring you about centos, Red Hat and Ubuntu how to turn off and turn on iptables and firewalld firewalls. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

There are different distributions of the Linux system, and different distributions have different commands to turn on or off the system firewall. Please match the operation commands of the following distributions according to the version.

CentOS 5/CentOS 6

On CentOS 5 and CentOS 6 systems, refer to the following information on how to turn on the firewall, turn off the firewall, and view the operational status of the firewall:

Turn on the firewall

Service iptables start

Turn off the firewall

Service iptables stop

View firewall running status

Service iptables statusCentOS 7/Red Hat 7/Alibaba Cloud Linux 2

In CentOS 7, Red Hat, and Alibaba Cloud Linux 2

In the system, please refer to the following information about how to turn on the firewall, turn off the firewall, and view the running status of the firewall:

Turn on the firewall

Systemctl start firewalld.service

Turn off the firewall

Systemctl stop firewalld.service

View firewall running status

Firewall-cmd-stateUbuntu

In the Ubuntu system, refer to the following information about how to turn on the firewall, turn off the firewall, and view the running status of the firewall:

Turn on the firewall

Ufw enable

Turn off the firewall

Ufw disable

View firewall running status

Ufw statusDebian

In the Debian system, there is no firewall installed by default. You can delete the relevant shielding rules by emptying the firewall policy. The specific actions are as follows:

Note: be sure to back up the firewall policy before emptying the policy.

Back up the firewall policy by executing the following command.

Touch [$Iptables] iptables-save > [$Iptables]

Note: [$Iptables] is the backup file address of the firewall policy.

Execute the following command to clear the firewall policy.

Iptables-F above is the centos, Red Hat and Ubuntu shared by the editor on how to turn off and enable iptables and firewalld firewalls. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are 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.

Share To

Development

Wechat

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

12
Report