Skip to contentSkip to conversation

rules disappear after a few seconds

DISCUSSION Jean-Christian Imbeault 2 participants 3 messages Feb 17, 2003

lore
Share & tools
lore
#0 lore raw

Ok, this one is bizarre. I have a small shell script to clear my iptables rules and then insert 9 rules. If I run my script and then do "iptables -n -L" my rules show up.

If I keep doing "iptables -n -L" after about 10-20 seconds the rules disappear and I am left with three empty INPUT/OUTPUT/FORWARD tables.

Where did my rules go? What made them disappear?

Thanks,

Jc

#1 lore raw
Quoted 8 lines · Jean-Christian Imbeault

Ok, this one is bizarre. I have a small shell script to clear my iptables rules and then insert 9 rules. If I run my script and then do "iptables -n -L" my rules show up.

If I keep doing "iptables -n -L" after about 10-20 seconds the rules disappear and I am left with three empty INPUT/OUTPUT/FORWARD tables.

Where did my rules go? What made them disappear?

Does this happen if you add rules manually, from a console, or only from the script?

I've never heard of any bug that could cause this, there must be something that is explicitly removing the rules, or using "iptables -F" or similar to flush rules from the chains.

If you have nat or mangle table enabled, try creating a rule in one of them as well, and listing that table with "iptables -n -L nat" or "-L mangle" and see if the same thing happens there.

j

#2 lore raw

My bad. I had forgotten that I had set up a cron job to flush all the rules every minute in case I had lock myself out of my box ...

Doh!

Jc