summaryrefslogtreecommitdiff
path: root/package/iptables/files/firewall.init
diff options
context:
space:
mode:
Diffstat (limited to 'package/iptables/files/firewall.init')
-rwxr-xr-xpackage/iptables/files/firewall.init35
1 files changed, 35 insertions, 0 deletions
diff --git a/package/iptables/files/firewall.init b/package/iptables/files/firewall.init
new file mode 100755
index 000000000..b3ea698d6
--- /dev/null
+++ b/package/iptables/files/firewall.init
@@ -0,0 +1,35 @@
+#!/bin/sh
+#PKG iptables
+#INIT 45
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${firewall:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ . /etc/firewall.conf
+ ;;
+stop)
+ ### Clear tables
+ iptables -F
+ iptables -X
+ iptables -t nat -F
+ iptables -t nat -X
+ iptables -P INPUT ACCEPT
+ iptables -P FORWARD ACCEPT
+ iptables -P OUTPUT ACCEPT
+ iptables -t nat -P PREROUTING ACCEPT
+ iptables -t nat -P POSTROUTING ACCEPT
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit $?