summaryrefslogtreecommitdiff
path: root/multitech/contrib/ppp-masq-fw
diff options
context:
space:
mode:
authorJesse Gilles <jgilles@multitech.com>2011-06-28 15:16:57 -0500
committerJesse Gilles <jgilles@multitech.com>2011-06-28 15:16:57 -0500
commitb23d1d80a23e8ce1910ba7c5006a4fddf3325c7d (patch)
tree40a273fff1fab26a90870668e232b4d79b5ea908 /multitech/contrib/ppp-masq-fw
initial work on multitech bitbake layer for CoreCDP
Diffstat (limited to 'multitech/contrib/ppp-masq-fw')
-rw-r--r--multitech/contrib/ppp-masq-fw34
1 files changed, 34 insertions, 0 deletions
diff --git a/multitech/contrib/ppp-masq-fw b/multitech/contrib/ppp-masq-fw
new file mode 100644
index 0000000..f8b9718
--- /dev/null
+++ b/multitech/contrib/ppp-masq-fw
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+# Flush all the tables first
+iptables -t filter -F
+iptables -t nat -F
+iptables -t mangle -F
+
+iptables -t filter -P INPUT DROP
+iptables -t filter -A INPUT -i lo -j ACCEPT
+iptables -t filter -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
+
+# Accept ssh from the LAN (Wired)
+iptables -t filter -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
+# Accept http from the LAN (Wired)
+iptables -t filter -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
+# Accept tftp from the LAN (Wired)
+#iptables -t filter -A INPUT -i eth0 -p udp --dport 69 -j ACCEPT
+
+# Accept ssh from the WAN (Wireless)
+#iptables -t filter -A INPUT -i ppp0 -p tcp --dport 22 -j ACCEPT
+# Accept http from the WAN (Wireless)
+#iptables -t filter -A INPUT -i ppp0 -p tcp --dport 80 -j ACCEPT
+
+iptables -t filter -P FORWARD DROP
+iptables -t filter -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
+iptables -t filter -A FORWARD -i eth0 -o ppp0 -j ACCEPT
+
+iptables -t filter -P OUTPUT ACCEPT
+
+iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
+
+# turn on packet forwarding last
+echo 1 > /proc/sys/net/ipv4/ip_forward
+