Skip to content

Instantly share code, notes, and snippets.

Created April 1, 2013 02:30
Show Gist options
  • Save anonymous/5282921 to your computer and use it in GitHub Desktop.
Save anonymous/5282921 to your computer and use it in GitHub Desktop.
#!/bin/bash
inside_interface='wlan0'
rules() {
#while IFS= read -r line; do
while IFS= read line; do
OIFS="$IFS"
IFS=' '
read -a iptablesarguments <<< "${line}"
echo ${iptablesarguments[@]}
echo ${#iptablesarguments[@]}
#iptables ${line[@]}
done << EOF
-P FORWARD DROP
-P INPUT DROP
-P OUTPUT DROP
-N allowed-connection
-F allowed-connection
-A allowed-connection -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-A allowed-connection -i ${inside_interface} -m limit -j LOG --log-prefix \"Bad packet from ${inside_interface}:\"
-F
-X
-L
EOF
}
rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment