Переглянути джерело

Update 'quietcinsarmy.sh'

Added BLOCKMODE variable to manage how these rules are applied.
deadtom 1 місяць тому
батько
коміт
dbdc4bf406
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      quietcinsarmy.sh

+ 3 - 1
quietcinsarmy.sh

@@ -4,6 +4,8 @@ BADGUYS_FILE=""  # The location (full path) where you want to download the list
 CHAIN_NAME="CINSARMY_IPS"  # The firewall chain to hold the cinsarmy rules
 FIREWALL="/sbin/iptables"  # The path to iptables
 ETH=""  # The name of the ethernet port you'd like to apply these rules to. Example: eth1
+BLOCKMODE=""  # If you want these rules to apply to just this machine, this should be "INPUT".
+              # If you want these rules to apply to a network behind this machine, this should be "FORWARD".
 
 # echo "Downloading the cinsarmy bad guys list of IPs."
 
@@ -25,7 +27,7 @@ else
     # echo "Creating chain $CHAIN_NAME."
     $FIREWALL -N $CHAIN_NAME
 	# Jump to the our chain from the FORWARD CHAIN
-	$FIREWALL -A FORWARD -j $CHAIN_NAME
+	$FIREWALL -A $BLOCKMODE -j $CHAIN_NAME
 fi
 
 # echo "Processing the bad guys list..."