Packet Filtering
Packet Filtering
Input Output
Local Process
1. When a packet comes in, the kernel first
looks at the destination of the packet: this
is called routing.
2. If it’s destined for this box
• Passes downwards in the diagram
• To INPUT chain
• If it passes, any processes waiting for that packet
will receive it.
Routing
Forward
Otherwise go to step 3 Decision
Input Output
Local Process
Routing
Decision Forward
SYNOPSIS
iptables -[ADC] chain rule-specification [options]
iptables -[RI] chain rulenum rule-specification [options]
iptables -D chain rulenum [options]
iptables -[LFZ] [chain] [options]
iptables -[NX] chain
iptables -P chain target [options]
iptables -E old-chain-name new-chain-name
-N Create a new chain
-X Delete an empty chain
-P Change the policy for a built-in chain
-L List the rules in a chain
-F Flush the rules out of a chain
-Z Zero the packet and byte counters on all
rules in a chain