Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
2  
Dupe: serverfault.com/questions/129086/… –  user3914 Feb 9 '11 at 6:05

1 Answer 1

up vote 3 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

 
discard

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.