Iptables-howto translation summary and methods for setting up Internet access in case of full drop

Source: Internet
Author: User
Part A of this article is translated from iptables-HOWTO. A: basic iptables. 1. data on the basic network is transmitted in package units. The first part of the package contains the source address, destination address, and some management details. this part becomes the header. the rest of the package includes the transmitted file and becomes the body. some protocols, such as tcp, will Iptables-Translated by HOWTO.

A: basic iptables.
1. Network Basics
Data on the network is transmitted in packets. The first part of the package contains the source address, destination address, and some management details. this part becomes the header. the rest of the package includes the transmitted file and becomes the body.
Some protocols, such as tcp, will establish a link before data transmission. these special packages have special headers to indicate their identity, request, confirmation, or response.
2. what is a package filter?
The package filter is a series of software B, which can check the packet header to determine the fate of the package.
In linux, the package filter is based on the kernel, that is, the module exists in the kernel.
3. Why do we need packet filtering?
Control, confidentiality, watchfulness (alert ).
Control: controls the data packets that enter and exit the host.
Confidentiality: you can control access to the host, which may pose potential threats.
Watchfulness (alert): from time to time there will be a wrong set of hosts, a large number of outgoing packets (probably already under control), packet filtering can solve this problem, this prevents local hosts from being controlled against hosts in other regions.
4. how does the package pass the filter?
Process:
1) When a packet passes through the NIC, the kernel first checks its destination address. this process is called "routing ".
2) if it is determined that the package is local, the package will pass the INPUT chain. if the package is accept, all local processes waiting for the package will accept it.
3) Otherwise, if no forward is set for the local host, the packet will be discarded. If a forward is set for the local host and the forward chain accept is set for the local host, the package will be thrown into another network interface (Nic or serial port) and forwarded out.
4) the process on the local host can also send packets. if the packet is the output chain accept, it will be thrown to a specific interface for forwarding (this interface can be arbitrary ).
Based on the above rules, we can understand some issues that must be paid attention to when using iptables.
5. use iptables.
The input, output, and forward tables cannot be deleted.
-N: create a new chain.
-X deletes an empty chain.
-P changes an existing chain policy.
-L list all rules in a chain.
-F: clears all rules in a chain.
There are several methods to operate rules in the chain.
-A adds A rule to the chain.
-I insert a rule somewhere in the chain.
-R clears this rule at a certain position in the chain.
-D: delete this rule at a certain position in the chain.
By default, the input and output policies are accept, and the forward Policy is 0, indicating that the input and output policies are disabled.
The above content

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.