rules disappear after a few seconds
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
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
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