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