What Is Linux Firewall Iptables? Iptables is a user-space application program that allows a system administrator to configure the tables provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and rules it stores. Different kernel modules and programs are currently used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames.
How To Check The Status Of Linux Iptables Firewall?you can use the following command to check the status of Iptables IPv4/Ipv6 frewall, enter:
For IPv4 protocal:
- Code:
-
1 | - Code:
-
[root@devops ~] - Code:
-
# service iptables status |
- Code:
-
2 | - Code:
-
iptables: Firewall is not running. |
OR
- Code:
-
1 | - Code:
-
[root@devops ~] - Code:
-
# /etc/init.d/iptables status |
- Code:
-
2 | - Code:
-
iptables: Firewall is not running. |
For IPv6 protocal:
- Code:
-
1 | - Code:
-
[root@devops ~] - Code:
-
# service ip6tables status |
- Code:
-
2 | - Code:
-
ip6tables: Firewall is not running. |
OR
- Code:
-
1 | - Code:
-
[root@devops ~] - Code:
-
# /etc/init.d/ip6tables status |
- Code:
-
2 | - Code:
-
ip6tables: Firewall is not running. |
How To Disable Linux Firewall Iptables?First login the system as the root user, then running the following commands to stop the Iptables Firewall:
For IPv4 running the following three commands:
- Code:
-
1 | - Code:
-
# service iptables save |
- Code:
-
2 | - Code:
-
# service iptables stop |
- Code:
-
3 | - Code:
-
# chkconfig iptables off |
For IPv6 running below three commands:
- Code:
-
1 | - Code:
-
# service ip6tables save |
- Code:
-
2 | - Code:
-
# service ip6tables stop |
- Code:
-
3 | - Code:
-
# chkconfig ip6tables off |
If you want to disable linux iptables on all the run levels running the below commands:
- Code:
-
1 | - Code:
-
#chkconfig -level 123456 iptables off |
If you want to remove iptables completly you can erase the iptables rpm package directlry using the following rpm command:
- Code:
-
1 | - Code:
-
#rpm -e iptables |
How To Enable linux Firewall (Iptables)?you can run the folllowing command to enable the iptables frewall again:
For IPv4:
- Code:
-
1 | - Code:
-
# service iptables start |
- Code:
-
2 | - Code:
-
# chkconfig iptables on |
For IPv6:
- Code:
-
1 | - Code:
-
# service ip6tables start |
- Code:
-
2 | - Code:
-
# chkconfig ip6tables on |
then reboot the system:
Done!