Created
April 1, 2013 02:30
-
-
Save anonymous/5282921 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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