Editing iptables rules with custom chain

Hello,

I have iptables service running on my CentOS5 server. It has approx 50 rules right now.

The problem I am facing now is as follows -

I have to define a new chain in the filter table, say DOS_RULES [rules related to preventing DOS attacks] & add all rules in this chain starting from index number 15 in the filter table.

I used the following commands to try it out -

/sbin/iptables -N DOS_RULES
/sbin/iptables -A DOS_RULES 15 -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,PSH,URG -j DROP
Bad argument `15'
Try `iptables -h' or 'iptables --help' for more information.

Any idea how to achieve adding the new rule at index 15 & also in the DOS_RULES chain?

The rules is successfully appended at the end of the filter table if I remove the index number from the command

Thanks
Bhushan

Well, -A stands for append and -I is for inserting. So try

/sbin/iptables -I DOS_RULES 15 -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,PSH,URG -j DROP