Super User is a question and answer site for computer enthusiasts and power users. 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

In Ubuntu 12.04 and above there are no iptable rules defined by default. I added the following rule and it works fine:(Update)

iptables -A INPUT -p tcp -j QUEUE -m string --string xyz --algo bm

Now, in fedora 15 and above there are some predefined rules by default. The output of iptables -L is:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited

Now, when i add my rule to iptables, it doesn't work. To make it work, i have to flush the iptables every time before adding my rule, which is undesirable. So, if somebody could resolve the conflict between above rules and my rule, or if there is an alternate method to make sure such a conflict doesn't arise in any case, i would be deeply thankful.

share|improve this question
up vote 1 down vote accepted

Your command has -D which is used to delete a rule so I'm assuming that is a typo. I'm also assuming that you meant to say that your using the append (-A) command to add the rule to the chain (INPUT) If this is the case the new rule will appear at the end of the chain, after the REJECT all so it will never get hit. Try running:

iptables -I INPUT 1 -p tcp -j QUEUE -m string --string xyz --algo bm

That will insert the rule before any of the other rules in the INPUT chain causing it to be hit first.


share|improve this answer
Thanks a ton. Solved the problem! – adnan kamili Dec 9 '12 at 13:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .