Browse files

Add some commenting

  • Loading branch information...
1 parent 87d377e commit 0d2fdacd3d34ad5724863fec2317e4a75c3aa58f @akkana committed Nov 2, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 masq
View
4 masq
@@ -12,15 +12,19 @@ pi_net=192.168.0
myaddr=$(ifconfig wlan0 | grep 'inet addr:' | sed -e 's/.*addr://' -e 's/ *Bcast:.*//')
echo My wlan0 address is $myaddr
+# Set up IP masquerading:
modprobe ipt_MASQUERADE
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to $myaddr
echo 1 > /proc/sys/net/ipv4/ip_forward
+# A little security: set it up so that the pi can send us anything,
+# but outside hosts can't:
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW ! -i wlan0 -j ACCEPT
iptables -P INPUT DROP
+# Bring up eth0 so we can actually talk:
ifconfig eth0 ${pi_net}.1 up

0 comments on commit 0d2fdac

Please sign in to comment.