Home > Operation and Maintenance > Linux Operation and Maintenance > What is the command to turn off the firewall in Linux?

What is the command to turn off the firewall in Linux?

青灯夜游
Release: 2019-06-05 13:29:52
Original
19530 people have browsed it

Linux firewall (Iptables) is an IP packet filtering system integrated into the Linux kernel. If the Linux system is connected to the Internet or LAN, a server, or a proxy server connecting LAN and the Internet, this system is conducive to better control on Linux. IP packet filtering and firewall configuration. The following article will introduce to you how to turn off and turn on the Linux firewall. I hope it will be helpful to you.

What is the command to turn off the firewall in Linux?

Method 1: chkconfig command

The chkconfig command can permanently turn off the firewall and take effect after restarting . (Recommended learning: linux video tutorial)

Turn off the firewall:

chkconfig iptables off
Copy after login

Turn on the firewall:

chkconfig iptables on
Copy after login

Method 2, service The command

service command can only temporarily turn off the firewall. It takes effect immediately and will become invalid after restarting.

Turn off the firewall:

service iptables stop
Copy after login

Turn on the firewall:

service iptables start
Copy after login

It should be noted that the above commands can be used to open and close other services under Linux.

When the Linux firewall (Iptables) is turned on, make the following settings, open ports 25 and 110, modify the /etc/sysconfig/iptables file, and add the following content:

-A RH-Firewall-1-INPUT -m state --state NEW -p tcp -m tcp --dport 25 --syn -j ACCEPT  
-A RH-Firewall-1-INPUT -m state --state NEW -p tcp -m tcp --dport 110 --syn -j ACCEPT
Copy after login

For more Linux-related technical knowledge, please visit the linux introductory tutorial column to learn!

The above is the detailed content of What is the command to turn off the firewall in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template