[ Team LiB ] |
Recipe 2.17 Deleting Firewall Rules2.17.1 ProblemYou want to delete firewall rules, individually or all at once. 2.17.2 SolutionTo delete rules en masse, also called flushing a chain, do the following: For iptables: # iptables -F [chain] For ipchains: # ipchains -F [chain] To delete rules individually: For iptables: # iptables -D chain rule_number For ipchains: # ipchains -D chain rule_number 2.17.3 DiscussionRules are numbered beginning with 1. To list the rules: # iptables -L # ipchains -L select one to delete (say, rule 4 on the input chain), and type: # iptables -D INPUT 4 # ipchains -D input 4 If you've previously saved your rules and want your deletions to remain in effect after the next reboot, re-save the new configuration. [Recipe 2.19] 2.17.4 See Alsoiptables(8), ipchains(8). |
[ Team LiB ] |