How to permanently disable firewall in Red Hat Linux
I have followed the below steps to disable the firewall in Linux. After reboot, again firewall is enabled. How to disable firewall permanently?
Login as the root user.
-
Next enter the following three commands to disable firewall.
service iptables save service iptables stop chkconfig iptables off
-
Disable IPv6 firewall.
service ip6tables save service ip6tables stop chkconfig ip6tables off
For version 7 of CentOS or RedHat Enterprise you must use the command systemctl.
For example:
#Check status:
systemctl status firewalld
#Stop firewall:
systemctl stop firewalld
#Disable firewall:
systemctl disable firewalld
Extracted from: http://www.sysadmit.com/2016/12/linux-deshabilitar-firewall-redhat-centos.html
FYI: This no longer works in RHEL7, and the handy init.d script has been removed.
The following worked for me.
systemctl stop firewalld
systemctl disable firewalld
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT