Debian Linux Stop Iptables Firewall

H do I stop Iptables firewall under Debian Linux server system?

The iptables command is used to set up, maintain, and inspect the tables of IPv4 packet filter rules in the Linux kernel.

Several different tables may be defined. Each table contains a number of built-in chains and may also contain user-defined chains. You can use the following commands to stop firewall under Debian Linux.

Syntax

First you need to login as root user.

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements None
Est. reading time N/A
If it is a remote server login over the ssh session using the following syntax:
$ ssh user@server1.cyberciti.biz
The syntax is as follows:

iptables options
iptables -X
iptables -F
iptables -t table -X
iptables -t table -F
iptables -P chain ACCEPT

To flush the selected chain or all the chains in the table pass the -F option to iptables command. This is equivalent to deleting all the rules one by one. To delete the optional or all the user-defined chain pass the -X option to iptables command. You also need to delete nat and mangle tables using the -F and -X options. Finally, set the default policy to ACCEPT.

Example

Type the following command to save existing iptables configuration.
iptables-save > /root/working.iptables.rules

To stop firewall type the following commands (see syntax above for detiled information):

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

You can also use this shell script to stop firewall.


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 4 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
4 comments… add one
  • sd Apr 4, 2012 @ 8:49

    or /etc/init.d /firestarter sop

  • Norbert Seibert Oct 26, 2012 @ 18:36

    Did you really mean:
    /etc/init.d/firestarter sop or
    /etc/init.d/firestarter stop ?

    Cheers,
    Norbert

  • thong veasna Oct 19, 2015 @ 4:04

    i want to see simple iptables of debian

    • 🐧 Vivek Gite Oct 19, 2015 @ 8:26

      Type following as root user:

      iptables -L -n -v

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum