From d73b478a9e9c37e7d6eebc52c803eafa92ffaf58 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Wed, 9 Mar 2016 01:07:10 +0100 Subject: IPTables-save added --- Bash/iptables-whiteblacklisting.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 @@ -43,6 +43,12 @@ BLACKLISTING=() 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 #=============================================================================== @@ -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 -- cgit v1.2.3