Iptables
|
Previous Top Next |
iptables F INPUT
|
# FLUSH THE INPUT CHAIN (remove all rules)
|
iptables P INPUT DROP
|
# SET THE DEFAULT POLICY TO DROP
|
iptables -F OUTPUT
|
# FLUSH THE OUTPUT CHAIN
|
iptables P OUTPUT DROP
|
# SET THE DEFAULT POLICY TO DROP
|
iptables F FORWARD
|
#
|
iptables P FORWARD DROP
|
#
|
-A INPUT
|
means that we want to configure the input chain
|
-p TCP
|
refers to only TCP packets (and not UDP packets)
|
--dport 80
|
matches only packets that were sent to port 80
|
-i eth0
|
applies only to the eth0 interface
|
-j ACCEPT
|
jumps to the ACCEPT target, hence lets the packet pass
|
-A OUTPUT
-p TCP -o eth0 -m state --state ESTABLISHED -j ACCEPT |
packets leaving our interface
TCP only packets leaving interface eth0 specify a state only related packets are allowed, not new connections let the packet go trough |
- | Originate from our internal networks ip address space
|
- | Leave the firewall on its external interface
|
- | Where are the packets originating from
|
- | Where are the packets going to
|
- | What protocol will be used
|
- | Will packets be sent to the firewall or will they be forwarded?
|
- | If the packets will be modified (NAT), will they be changed before or after routing
|