diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index 9bc36911f..4e660f652 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -2394,6 +2394,17 @@ EOF case $COMMAND in stop|clear|restore) + if chain_exists dynamic; then +EOF + + if ( $family == F_IPV4 ) { + emit( ' ${IPTABLES}-save -t filter | grep \'^-A dynamic\' > ${VARDIR}/.dynamic' ); + } else { + emit( ' ${IP6TABLES}-save -t filter | grep \'^-A dynamic\' > ${VARDIR}/.dynamic' ); + } + + emit <<'EOF'; + fi ;; *) set +x