|
A rule can be deleted in one of two ways. If the rule number is known a numbered delete can be used, as in: # iptables -D INPUT 15 # To delete rule number 15 in the INPUT chain. The second way is to mirror the -A command, but replacing the -A with -D. This is useful when you have a complex chain of rules and you don't want to have to count them to figure out that it's rule 37 that you want to get rid of. In this case, we would use: # ipchains -D INPUT -s 127.0.0.1 -p icmp -j DROP # The syntax of -D must have exactly the same options as the -A (or -I or -R) command. If there are multiple identical rules in the same chain, only the first will be deleted. |
Last revised Fri, 25 May 2007 12:33:09 -0400