Home > Article > Operation and Maintenance > What is the command to turn off the firewall in Linux?
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.
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
Turn on the firewall:
chkconfig iptables on
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
Turn on the firewall:
service iptables start
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
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!