How to clear an iptables rule

Source: Internet
Author: User

ClearOne of themIptablesThe rule is actually very simple:

Use iptables-I FORWARD-s XXX. XXX. XXX. after XXX-j drops multiple rules, how can I clear only one of them? I use IPCOP. After iptables-F is used, all rules will be cleared. Only after the router is restarted can I access the internet, how can I clear only one of them without clearing all of them?

A. Add A rule.

-D. delete a rule.

-I insert a rule

-F clears a chain

We can use either of the two methods to delete a rule. First, because we know that this is the only rule in the INPUT chain, we will delete it by number:

# Iptables-d input 1

Delete the rule numbered 1 in the INPUT chain

The second method is-A command ing, but replace-A with-D. This is useful when the rules in your chain are complex and you do not want to calculate their numbers. In this case, we can use:

# Iptables-d input-s 127.0.0.1-p icmp-j DROP

The-D syntax must be as accurate as-A (or-I or-R. If the chain contains multiple identical rules, only the first rule is deleted.

Through the above article, we should all learn one of the two methods. I hope this article will help you!

  • How to clear iptables rules
  • How to save iptables configuration
  • How to save the firewall rules of iptables
  • Iptables logs are saved using MySQL
  • Disable commands related to Iptables Firewall
  • How to disable the iptables network port
  • How to disable iptables in UBUNTU

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.