Disable Linux Firewall

When preparing your RHEL server for an Oracle RDBMS or other application software installations, it is normally a good idea to temporarily disable the OS layer firewall to prevent possible communication errors. This can be performed with the command CHKCONFIG. Use the following procedures to check and disable or enable the RHEL firewall.

1. Logon as the root user.
Using username “root”.
Last login: Mon Jun 2 08:57:14 2014 from 192.168.10.1
[root@linuxpc ~]#
2. Check the current status of RHEL firewall with command ‘SERVICE’ command.
[root@linuxpc ~]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all — 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 ACCEPT icmp — 0.0.0.0/0 0.0.0.0/0
3 ACCEPT all — 0.0.0.0/0 0.0.0.0/0
4 ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
5 REJECT all — 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all — 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

[root@linuxpc ~]#

3. As shown above the firewall is currently active, You can disable now with the ‘SERVICE’ command.
[root@linuxpc ~]# service iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
[root@linuxpc ~]#

4. Or you can use the ‘CHKCONFIG’ command to disable the RHEL firewall, which shuts the firewall down on reboot. This is done by adding references to the appropriate /etc/rc.d directory to either kill the service or start the service at given run level.
[root@linuxpc ~]# chkconfig iptables off
[root@linuxpc ~]#

Larry Catt, OCP

Leave a Reply