Tuesday, August 7, 2012

How to disable / enable Linux Firewall (Red Hat, CentOS, Fedora)?


To disable Linux firewall:
1. Login as a root user.
2. Run the following commands:
/etc/init.d/iptables save
/etc/init.d/iptables stop
You'll see the similar output, and the firewall will be turned off.
[root@orahost ~]# /etc/init.d/iptables save
Saving firewall rules to /etc/sysconfig/iptables:          [  OK  ]
[root@orahost ~]# /etc/init.d/iptables stop
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter                    [  OK  ]
Unloading iptables modules:                                [  OK  ]
[root@orahost ~]#
To enable Linux firewall:
1. Login as a root user.
2. Run the following command:
/etc/init.d/iptables start
You'll get the similar output, and the firewall will be turned on.
[root@orahost ~]# /etc/init.d/iptables start
Applying iptables firewall rules:                          [  OK  ]
Loading additional iptables modules: ip_conntrack_netbios_n[  OK  ]ntrack_tftp
[root@orahost ~]#

No comments: