Iptables firewall for creating a secure network

Source: Internet
Author: User
Article Title: iptables Firewall creates a secure network. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Security is always a constant topic on the Internet. Only when the network exists will there be security problems, and you will face the risk of being attacked. Use the iptables/netfilter network architecture after the Linux2.4 kernel to implement the packet filtering firewall. To some extent, it replaces the common functions of hardware firewalls to create a secure network environment.

The so-called "packet filtering" technology, that is, through the "quintuple" of matching data-Source ip, destination ip, source port, destination port and protocol (ip, tcp, udp, icmp ). A general network firewall ensures Intranet security by matching the data.

Iptables and netfilter

 I. First, we need to clarify these two concepts:
1. the linux firewall is implemented by the linux kernel, rather than by the system's service programs. The linux kernel uses the netfilter architecture to implement this function.

2. iptables is only a management tool for netfilter. Implement firewall policies by managing iptables.

Ii. "Three Disciplines" and "five notes" in iptables"

1. Three disciplines: nat filter and mangle
2. five major notes: PREROUTING, FORWARD, POSTROUTING, INPUT, and OUTPUT

The architecture diagram is as follows:

-------- PREROUTING --- → [ROUTING] ----> FORWARD ----- → POSTROUTING
Mangle| Mangle BytesMangle
Nat| Filter |Nat
|
Optional |
INPUT OUTPUT
|Mangle|Mangle
BytesFilter|Nat Filter
| ------------ → Local ----------- → |

Filter, nat, and mangel are rule tables, and the other five are rule chains. The rules are included in the chain, and the Rule chain is included in the rule table. Nat is used for address translation, filter is used for packet filtering (the most used is the IP address), and mangel is used for Policy Routing and Traffic Shaping (a bit QOS). The rule chain is allocated as follows:

* Filter: INPUT, FORWARD, and OUTPUT
* Nat: PREROUTING, POSTROUTING, and OUTPUT
* Mangel: PREROUTING, POSTROUTING, OUTPUT, INPUT, and FORWARD

[1] [2] [3] Next page

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.