summaryrefslogtreecommitdiffstats
path: root/Bash/iptables-whiteblacklisting.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Bash/iptables-whiteblacklisting.sh')
-rwxr-xr-xBash/iptables-whiteblacklisting.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/Bash/iptables-whiteblacklisting.sh b/Bash/iptables-whiteblacklisting.sh
index a34757d..530c801 100755
--- a/Bash/iptables-whiteblacklisting.sh
+++ b/Bash/iptables-whiteblacklisting.sh
@@ -44,6 +44,12 @@ IPTABLES_V4=`which iptables`
IPTABLES_V6=`which ip6tables`
#===============================================================================
+# Define IPTables-save commands for IPv4 and IPv6
+#===============================================================================
+IPTABLES_SAVE_V4=`which iptables-save`
+IPTABLES_SAVE_V6=`which ip6tables-save`
+
+#===============================================================================
# Wrapper function for IPTables with IPv4 and IPv6
#===============================================================================
IPTABLES() {
@@ -135,4 +141,10 @@ fi
# ADDITIONAL RULES
#===============================================================================
${IPTABLES_V4} --append INPUT --source 192.168.1.0/24 --jump ACCEPT
-${IPTABLES_V6} --append INPUT --source fe80::/64 --jump ACCEPT \ No newline at end of file
+${IPTABLES_V6} --append INPUT --source fe80::/64 --jump ACCEPT
+
+#===============================================================================
+# Save IPTables configuration permanent
+#===============================================================================
+if [ ${IPTABLES_SAVE_V4} ]; then ${IPTABLES_SAVE_V4} > /etc/iptables/rules.v4; fi
+if [ ${IPTABLES_SAVE_V6} ]; then ${IPTABLES_SAVE_V6} > /etc/iptables/rules.v6; fi \ No newline at end of file