how to close iptables and reboot iptables on debian--wheezy?

Posted February 11, 2015 51.1k views

service iptables stop
service iptables restart
The two commands can’t work on my debian–wheezy ,how to close iptables and reboot iptables on debian–wheezy?

1 comment
  • If you are unable to restart the services in this way you can also try calling the init scripts directly:

    /etc/init.d/iptables stop
    /etc/init.d/iptables restart

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

iptables is not a system service, but a single command. RedHat-based distros ship with an init script for convenience which allows you to save your iptables configuration, but this is not present on Ubuntu or Debian. You can get similar functionality by using iptables-persistent You can install it with:

  • sudo apt-get update
  • sudo apt-get install iptables-persistent

Then save your rules by running:

  • sudo service iptables-persistent save

And it flush your IPtables rules, effectively disabling your firewall, run:

  • sudo service iptables-persistent stop

While this article is targeted at Ubuntu, it applies to Debian as well. Check it out for more info on IPtables:

by Justin Ellingwood
The iptables firewall is a great way to secure your Linux server. In this guide, we'll discuss how to configure iptables rules on an Ubuntu 14.04 server.