3 # source application-specific settings
4 #[ -f /etc/conf.d/iptables ] && . /etc/conf.d/iptables
6 IPTABLES
='/usr/sbin/iptables'
14 stat_busy
"Starting fina firewall"
24 stat_busy
"Stopping fina firewall"
26 for table
in $
(cat /proc
/net
/ip_tables_names
) ; do
27 $IPTABLES -t $table -F &>/dev
/null
&& \
28 $IPTABLES -t $table -X &>/dev
/null
&& \
29 $IPTABLES -t $table -Z &>/dev
/null
30 [ $?
-gt 0 ] && fail
=1
32 if [ $fail -gt 0 ]; then
37 for table
in filter nat mangle raw
; do
38 if grep -qw $table /proc
/net
/ip_tables_names
; then
39 $IPTABLES -t $table -P OUTPUT ACCEPT
42 for table
in filter mangle
; do
43 if grep -qw $table /proc
/net
/ip_tables_names
; then
44 $IPTABLES -t $table -P INPUT ACCEPT
45 $IPTABLES -t $table -P FORWARD ACCEPT
48 for table
in nat mangle raw
; do
49 if grep -qw $table /proc
/net
/ip_tables_names
; then
50 $IPTABLES -t $table -P PREROUTING ACCEPT
53 for table
in nat mangle
; do
54 if grep -qw $table /proc
/net
/ip_tables_names
; then
55 $IPTABLES -t $table -P POSTROUTING ACCEPT
67 echo "usage: $0 {start|stop|restart}"