Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use IPTABLES in /etc/network/interfaces

pre-up iptables-restore /etc/firewall.txt

I tried searching for some thing like /etc/init.d/iptables on Ubuntu but that does not seem to exist.So if I have to stop IPTABLE for temporarily for sysadmin work how can I do that?

share|improve this question
Dupe:… – user3914 Feb 9 '11 at 6:05
up vote 7 down vote accepted

iptables is not a service, but a facility inside the kernel. That is why you can't stop it.

If you ever need to stop iptables quickly, here's my suggestion:

  1. Configure your iptables to completion.

  2. Save the configuration first: iptables-save > /etc/iptables.conf

  3. Flush the iptables, and configure it 'open':

    • All policies set to ACCEPT
    • Configure all necessary NATs for your sysadmin to work
    • If you use Policy-Based Routing in the mangle table, also configure it as necessary
  4. Save the 'open' ruleset: iptables-save > /etc/open-iptables.conf

Now, whenever you need to quickly 'disable' iptables, do:

cat /etc/open-iptables.conf | iptables-restore.

After that, 're-enable' iptables using:

cat /etc/iptables.conf | iptables-restore

( iptables-restore < /etc/open-iptables.conf might also work; but I've read somewhere else that sometimes it doesn't work )

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.