Howto stop iptables firewall on Debian 8 Linux system

undefined

In this mini post I’ll show you two methods to stop iptables on Debian 8 “Jessie”, and Ubuntu 14.04, and higher.

Method 1: using the iptables command line.

The first step to do is to save the applied iptables rules “you may need them in the future”, run the following command to save them.

# iptables-save > /root/currently_applied_iptables_rules

Then change the default policies before flushing / removing the applied rules, run the following commands to stop the iptables:

# iptables -P INPUT ACCEPT
# iptables -P OUTPUT ACCEPT
# iptables -P FORWARD ACCEPT
# iptables -F
# iptables -X
# iptables -t nat -F
# iptables -t nat -X
# iptables -t mangle -F
# iptables -t mangle -X

As you see first we allowed the default policies to accept all connections for filter table, then removed the applied rules by flushing them for the three tables ” filter, nat, and mangle”.

Method 2: using netfilter-persistent command line.

The first step to do is to save the applied iptables rules “you may need them in the future”, run the following command to save them.

# iptables-save > /root/currently_applied_iptables_rules

Then, you need to install this package “iptables-persistent”, run the following command, and accept all OK by pressing ENTER key:

# apt-get -y install iptables-persistent

Now, we only need to run one command to stop iptables firewall, run the following command:

# netfilter-persistent flush

Now, any of the above two methods will remove the applied iptables rules. Personally I prefer method two.

If You Appreciate What We Do Here On Mimastech, You Should Consider:

  1. Stay Connected to: Facebook | Twitter | Google+
  2. Support us via PayPal Donation
  3. Subscribe to our email newsletters.
  4. Tell other sysadmins / friends about Us - Share and Like our posts and services

We are thankful for your never ending support.

Leave a Reply

Your email address will not be published. Required fields are marked *