Introduction to iptables on red-flag Linux (1)

Source: Internet
Author: User
Article Title: iptables usage on red-flag Linux (1 ). 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.

Iptables Introduction

  IptablesIs a powerful packet filtering-based network tool.IptablesAnd how to use it to build a network firewall.

IptablesIt is composed of two subsystems, namely the kernel module and user interface application program. It can be compiled into the system kernel or into a detachable kernel module, you can also choose to install some components that can complete certain functions.IPAddress camouflage, port ing, packet filtering, and other functions.

InstallIptables

IptablesThe configuration and compilation of many components are associated with the Kernel configuration and compilation.LinuxThe release has been installed in advance.Iptables, SuchRedHat,RedFlag. However, you may need to install it on your own.

First, you need2.4.XThe kernel version above,FromHttp://Kernel.orgDownload.

You also needIptablesUser space program, which can beNetfilterDownload the homepage.

Compile the program after you prepare for it.Translation kernel,InNetworking OptionsFindNetwork packet filteringSubitem,SelectNetwork packet filtering replaces ipchainsAnd configure.

Compile with the new kernel bootIptablesUser space program,The installer copies the executable files/Usr/local/sbinDirectory.

If everything goes well, we have successfully installedIptablesAndNetfilter.

You can useService iptables startStart the service.

Table and chain

Here we will discuss the data packet inIptablesHow to transfer between the chain and the table.

For example, a data packet sent from an external host to the local machine must be received by the application in the following ways:

1.Packets are transmitted from the network and received by the network adapter.

2.Subsequent TransferMangleTablePREROUTINGChain.

3.Transfer againNatTablePRETOUTINGChain, which is mainly usedDNAT, That is, destination address forwarding.

4.Route determination.

5.Because data packets are transmitted to the local machineMangleTableINPUTChain.

6.Transfer inFilterTableINPUTChain.

7.The application that finally receives the data packet.

[1] [2] 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.