Restricting network access using Linux Iptables

Source: Internet
Author: User

Brief introduction:

Iptables is a user-state module, which is mainly configured for rules;

NetFilter is the kernel module, which is responsible for filtering actions.

Instance:

      1. Iptables–f
      2. Iptables–a input–i lo–j ACCEPT
      3. Iptables–a input–s 127.0.0.1–d 127.0.0.1–j ACCEPT
      4. Iptables–a input–p ICMP--icmp-type any–j ACCEPT
      5. Iptables–a input–p tcp–-dport 80–j ACCEPT
      6. Iptables–a input–p tcp–s 114.114.114.114–-sport 53–j ACCEPT
      7. Iptables–a input–p udp–s 114.114.114.114–-sport 53–j ACCEPT
      8. Iptables–a input–p tcp–s 8.8.8.8–-sport 53–j ACCEPT
      9. Iptables–a input–p udp–s 8.8.8.8–-sport 53–j ACCEPT
      10. Iptables–a input–p tcp–s x.x.x.x–-sport 22–j ACCEPT
      11. Iptables–a input–j DROP
      12. Iptables–a forword–j DROP

Attention:

When configuring a firewall policy to prevent yourself from being locked out of the server, you should be aware of the following two points:

1, in the computer room to carry out the operation of personnel;

2. Deploy in a test environment before the formal environment is deployed.

Restricting network access using Linux Iptables

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.