3 # Provides: iptables.sh
4 # Required-Start: $remote_fs $network
5 # Required-Stop: $remote_fs
6 # Default-Start: 2 3 4 5
8 # Short-Description: iptables firewall
13 . /etc/network/functions.phd
17 /etc/init.d/fail2ban stop
22 $IPTABLES -F -t mangle
25 $IPTABLES -P INPUT DROP
26 $IPTABLES -P OUTPUT ACCEPT
27 $IPTABLES -P FORWARD DROP
31 /etc/init.d/fail2ban start
35 /etc/init.d/fail2ban stop
39 $IPTABLES -F -t mangle
40 $IPTABLES -P INPUT DROP
41 $IPTABLES -P OUTPUT DROP
42 $IPTABLES -P FORWARD DROP
46 /etc/init.d/fail2ban stop
48 # Flush (delete) all rules
51 $IPTABLES -F -t mangle
52 $IPTABLES -P INPUT ACCEPT
53 $IPTABLES -P OUTPUT ACCEPT
54 $IPTABLES -P FORWARD ACCEPT
58 echo "Usage: firewall {start|stop|clear}"