Iptables are the most common firewall used in almost every Linux system. However, sometimes you may want to disable or stop iptables in Linux. For example, firewalld is a dynamic firewall manager that is often at conflict with iptables. So if you are installing firewalld on your system, you will need to disable iptables. In this article, we will look at how to disable iptables in Ubuntu/Debian systems.
How to Disable Iptables in Ubuntu
Here are the steps to disable iptables in Ubuntu. You will need to be logged in as user with root or sudo privileges to execute the following command. We will use ufw (Uncomplicated Firewall) command to start/stop/reload iptables. ufw command has the ability to control iptables, and provides many easy options to help you quickly manage iptables.
Get iptables status
Open terminal and run the following command to get current status of iptables.
$ sudo ufw status Status : inactive
Disable or Stop iptables in Ubuntu
Run the following command to disable or stop iptables.
$ sudo ufw disable
Start or Enable iptables
Run the following command to enable or start iptables.
$ sudo ufw enable
Reload iptables
The following command will reload iptables with the latest configuration and firewall rules.
$ sudo ufw reload
You can also use iptables command to start/stop/reload iptables.
Here is the command to get status of iptables
$ sudo iptables -L -n -v #ipv4 iptables $ sudo ip6tables -L -n -v #ipv6 iptables
Save Iptables
Here is the command to save iptables configuration to a file.
$ sudo iptables-save > $HOME/firewall.txt #ipv4 iptables $ sudo ip6tables-save > $HOME/firewall.txt #ipv6 iptables
Restore Iptables
Here is the command to restore iptables configuration.
$ sudo iptables-restore #ipv4 iptables $ sudo ip6tables-restore #ipv6 iptables
In this article, we have looked at how to start/stop/reload iptables in Linux. iptables is a robust firewall system for Linux but sometimes you want to disable or turn off iptables if it creates conflict with other software on your system.
Also read:
How to Create Swap Space in CentOS, Redhat
How to Install RPM package in Redhat, CentOS
How to Configure Firewalld in Redhat, CentOS Linux
How to Restart Linux Server from Command Line
How to Flush DNS Cache in Windows, Linux & Mac