iptables 4 Sheets: filter,nat,raw,mangle, where the default table is filter
such as: Iptables-a-P tcp-j accept equivalent to iptables-t filter-a-P tcp-j Accept
Iptables is the management tool for Linux, located in/sbin/iptables, the real implementation of the firewall is NetFilter, which implements the packet filtering structure in the Linux kernel.
the iptables contains 4 tables and 5 chains. Which means that according to the operation of the packet is differentiated, the chain is based on different hook points to differentiate, the table and chain is actually the NetFilter two dimensions.
4 tables are Filter,nat,mangle,raw, where the default table is filter. Table processing has a priority of raw>mangle>nat>filter.
Filter : General filtering function.
NAT: Used for address forwarding.
mangle: Used to modify a specific packet.
Raw: The highest priority, when setting raw, is generally to let iptables do the packet tracking processing, improve performance.
5 chains: Prerouting,input,output,postrouting,forward
prerouting: Before the packet enters the routing table.
INPUT: After routing the table, the destination is native.
FORWARD: The destination is not native after routing the table.
OUTPUT: Generated by this machine, forwarded outward.
postrouting: Before sending to the NIC interface.
Rules table:
1.filter: Three chains: Input,forward,output
Iptables 4 Table 5 chain (not finished)