forked from extern/shorewall_code
Compare commits
2 Commits
5.1.10.1
...
5.1.9-base
Author | SHA1 | Date | |
---|---|---|---|
|
670e3a0c6a | ||
|
cc02d2bb64 |
@@ -335,8 +335,9 @@ for f in lib.* ; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ $SHAREDIR != /usr/share ]; then
|
if [ $SHAREDIR != /usr/share ]; then
|
||||||
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/shorewall/lib.base
|
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/${PRODUCT}/lib.base
|
||||||
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/shorewall/lib.cli
|
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/${PRODUCT}/lib.core
|
||||||
|
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/${PRODUCT}/lib.cli
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@@ -1813,7 +1813,7 @@ do_dump_command() {
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
qt mywhich ss && ss -${g_family}tunap || { qt mywhich netstat && netstat -tunap; }
|
qt mywhich ss && ss -${g_family}tunap || { qt mywhich netstat && netatat -tunap; }
|
||||||
|
|
||||||
if [ -n "$TC_ENABLED" ]; then
|
if [ -n "$TC_ENABLED" ]; then
|
||||||
heading "Traffic Control"
|
heading "Traffic Control"
|
||||||
|
@@ -73,16 +73,12 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
||||||
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
if [ $PRODUCT = shorewall ]; then
|
||||||
return 0
|
${SBINDIR}/shorewall compile
|
||||||
|
elif [ $PRODUCT = shorewall6 ]; then
|
||||||
|
${SBINDIR}/shorewall -6 compile
|
||||||
else
|
else
|
||||||
if [ $PRODUCT = shorewall ]; then
|
return 0
|
||||||
${SBINDIR}/shorewall compile
|
|
||||||
elif [ $PRODUCT = shorewall6 ]; then
|
|
||||||
${SBINDIR}/shorewall -6 compile
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,14 +108,16 @@ shorewall_start () {
|
|||||||
|
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
#
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
# Run in a sub-shell to avoid name collisions
|
#
|
||||||
#
|
# Run in a sub-shell to avoid name collisions
|
||||||
(
|
#
|
||||||
if ! ${STATEDIR}/firewall status > /dev/null 2>&1; then
|
(
|
||||||
${STATEDIR}/firewall ${OPTIONS} stop
|
if ! ${STATEDIR}/firewall status > /dev/null 2>&1; then
|
||||||
fi
|
${STATEDIR}/firewall ${OPTIONS} stop
|
||||||
)
|
fi
|
||||||
|
)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -147,7 +145,9 @@ shorewall_stop () {
|
|||||||
printf "Clearing \"Shorewall-based firewalls\": "
|
printf "Clearing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} clear
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@@ -44,14 +44,12 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
||||||
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
if [ $PRODUCT = shorewall ]; then
|
||||||
return 0
|
|
||||||
elif [ $PRODUCT = shorewall ]; then
|
|
||||||
${SBINDIR}/shorewall compile
|
${SBINDIR}/shorewall compile
|
||||||
elif [ $PRODUCT = shorewall6 ]; then
|
elif [ $PRODUCT = shorewall6 ]; then
|
||||||
${SBINDIR}/shorewall -6 compile
|
${SBINDIR}/shorewall -6 compile
|
||||||
else
|
else
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,11 +75,15 @@ start () {
|
|||||||
retval=$?
|
retval=$?
|
||||||
|
|
||||||
if [ $retval -eq 0 ]; then
|
if [ $retval -eq 0 ]; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} stop 2>&1 | $logger
|
if [ -x "${STATEDIR}/firewall" ]; then
|
||||||
retval=${PIPESTATUS[0]}
|
${STATEDIR}/firewall ${OPTIONS} stop 2>&1 | $logger
|
||||||
[ $retval -ne 0 ] && break
|
retval=${PIPESTATUS[0]}
|
||||||
|
[ $retval -ne 0 ] && break
|
||||||
|
else
|
||||||
|
retval=6 #Product not configured
|
||||||
|
break
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
retval=6 #Product not configured
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -108,11 +110,15 @@ stop () {
|
|||||||
retval=$?
|
retval=$?
|
||||||
|
|
||||||
if [ $retval -eq 0 ]; then
|
if [ $retval -eq 0 ]; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear 2>&1 | $logger
|
if [ -x "${STATEDIR}/firewall" ]; then
|
||||||
retval=${PIPESTATUS[0]}
|
${STATEDIR}/firewall ${OPTIONS} clear 2>&1 | $logger
|
||||||
[ $retval -ne 0 ] && break
|
retval=${PIPESTATUS[0]}
|
||||||
|
[ $retval -ne 0 ] && break
|
||||||
|
else
|
||||||
|
retval=6 #Product not configured
|
||||||
|
break
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
retval=6 #Product not configured
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
20
Shorewall-init/init.openwrt.sh
Executable file → Normal file
20
Shorewall-init/init.openwrt.sh
Executable file → Normal file
@@ -75,14 +75,12 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
||||||
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
if [ $PRODUCT = shorewall ]; then
|
||||||
return 0
|
|
||||||
elif [ $PRODUCT = shorewall ]; then
|
|
||||||
${SBINDIR}/shorewall compile
|
${SBINDIR}/shorewall compile
|
||||||
elif [ $PRODUCT = shorewall6 ]; then
|
elif [ $PRODUCT = shorewall6 ]; then
|
||||||
${SBINDIR}/shorewall -6 compile
|
${SBINDIR}/shorewall -6 compile
|
||||||
else
|
else
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,8 +92,10 @@ start () {
|
|||||||
printf "Initializing \"Shorewall-based firewalls\": "
|
printf "Initializing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} stop
|
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} stop
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -103,8 +103,6 @@ start () {
|
|||||||
if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then
|
if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then
|
||||||
ipset -R < "$SAVE_IPSETS"
|
ipset -R < "$SAVE_IPSETS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boot () {
|
boot () {
|
||||||
@@ -119,7 +117,9 @@ stop () {
|
|||||||
printf "Clearing \"Shorewall-based firewalls\": "
|
printf "Clearing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} clear
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -131,7 +131,5 @@ stop () {
|
|||||||
rm -f "${SAVE_IPSETS}.tmp"
|
rm -f "${SAVE_IPSETS}.tmp"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -69,12 +69,10 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
||||||
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||||
return 0
|
|
||||||
elif [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
|
||||||
${SBINDIR}/$PRODUCT ${OPTIONS} compile $STATEDIR/firewall
|
${SBINDIR}/$PRODUCT ${OPTIONS} compile $STATEDIR/firewall
|
||||||
else
|
else
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,8 +84,10 @@ shorewall_start () {
|
|||||||
printf "Initializing \"Shorewall-based firewalls\": "
|
printf "Initializing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} stop
|
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} stop
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -107,7 +107,9 @@ shorewall_stop () {
|
|||||||
printf "Clearing \"Shorewall-based firewalls\": "
|
printf "Clearing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} clear
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@@ -79,14 +79,12 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
||||||
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
if [ $PRODUCT = shorewall ]; then
|
||||||
return 0
|
|
||||||
elif [ $PRODUCT = shorewall ]; then
|
|
||||||
${SBINDIR}/shorewall compile
|
${SBINDIR}/shorewall compile
|
||||||
elif [ $PRODUCT = shorewall6 ]; then
|
elif [ $PRODUCT = shorewall6 ]; then
|
||||||
${SBINDIR}/shorewall -6 compile
|
${SBINDIR}/shorewall -6 compile
|
||||||
else
|
else
|
||||||
return 6
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,8 +96,10 @@ shorewall_start () {
|
|||||||
printf "Initializing \"Shorewall-based firewalls\": "
|
printf "Initializing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
if [ -x $STATEDIR/firewall ]; then
|
||||||
$STATEDIR/$PRODUCT/firewall ${OPTIONS} stop
|
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
||||||
|
$STATEDIR/$PRODUCT/firewall ${OPTIONS} stop
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -117,7 +117,9 @@ shorewall_stop () {
|
|||||||
printf "Clearing \"Shorewall-based firewalls\": "
|
printf "Clearing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} clear
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@@ -33,12 +33,12 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
||||||
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
if [ $PRODUCT = shorewall ]; then
|
||||||
return 0
|
|
||||||
elif [ $PRODUCT = shorewall ]; then
|
|
||||||
${SBINDIR}/shorewall compile
|
${SBINDIR}/shorewall compile
|
||||||
elif [ $PRODUCT = shorewall6 ]; then
|
elif [ $PRODUCT = shorewall6 ]; then
|
||||||
${SBINDIR}/shorewall -6 compile
|
${SBINDIR}/shorewall -6 compile
|
||||||
|
else
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,14 +67,16 @@ shorewall_start () {
|
|||||||
printf "Initializing \"Shorewall-based firewalls\": "
|
printf "Initializing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
#
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
# Run in a sub-shell to avoid name collisions
|
#
|
||||||
#
|
# Run in a sub-shell to avoid name collisions
|
||||||
(
|
#
|
||||||
if ! ${STATEDIR}/firewall status > /dev/null 2>&1; then
|
(
|
||||||
${STATEDIR}/firewall ${OPTIONS} stop
|
if ! ${STATEDIR}/firewall status > /dev/null 2>&1; then
|
||||||
fi
|
${STATEDIR}/firewall ${OPTIONS} stop
|
||||||
)
|
fi
|
||||||
|
)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -93,7 +95,9 @@ shorewall_stop () {
|
|||||||
printf "Clearing \"Shorewall-based firewalls\": "
|
printf "Clearing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} clear
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@@ -13,6 +13,7 @@ DEFAULTS ACCEPT
|
|||||||
@1 - - icmp time-exceeded {comment="Needed ICMP types"}
|
@1 - - icmp time-exceeded {comment="Needed ICMP types"}
|
||||||
?else
|
?else
|
||||||
?COMMENT Needed ICMP types (RFC4890)
|
?COMMENT Needed ICMP types (RFC4890)
|
||||||
|
|
||||||
@1 - - ipv6-icmp destination-unreachable
|
@1 - - ipv6-icmp destination-unreachable
|
||||||
@1 - - ipv6-icmp packet-too-big
|
@1 - - ipv6-icmp packet-too-big
|
||||||
@1 - - ipv6-icmp time-exceeded
|
@1 - - ipv6-icmp time-exceeded
|
||||||
@@ -37,7 +38,7 @@ DEFAULTS ACCEPT
|
|||||||
@1 - - ipv6-icmp 148 # Certificate path solicitation
|
@1 - - ipv6-icmp 148 # Certificate path solicitation
|
||||||
@1 - - ipv6-icmp 149 # Certificate path advertisement
|
@1 - - ipv6-icmp 149 # Certificate path advertisement
|
||||||
|
|
||||||
# The following should have a link local source address and a ttl of 1 and must be allowed to transit a bridge
|
# The following should have a link local source address and a ttl of 1 and must be allowed to transit abridge
|
||||||
@1 fe80::/10 - ipv6-icmp 151 # Multicast router advertisement
|
@1 fe80::/10 - ipv6-icmp 151 # Multicast router advertisement
|
||||||
@1 fe80::/10 - ipv6-icmp 152 # Multicast router solicitation
|
@1 fe80::/10 - ipv6-icmp 152 # Multicast router solicitation
|
||||||
@1 fe80::/10 - ipv6-icmp 153 # Multicast router termination
|
@1 fe80::/10 - ipv6-icmp 153 # Multicast router termination
|
||||||
|
@@ -30,4 +30,4 @@
|
|||||||
|
|
||||||
DEFAULTS ACCEPT,-
|
DEFAULTS ACCEPT,-
|
||||||
|
|
||||||
@1 - - ;;+ -p 6 --tcp-flags ACK,FIN ACK,FIN
|
@1 - - ;;+ -p 6 --tcp-flags ACK,FIN,PSH ACK,FIN,PSH
|
||||||
|
@@ -59,7 +59,7 @@ our $have_arptables;
|
|||||||
# Initilize the package-globals in the other modules
|
# Initilize the package-globals in the other modules
|
||||||
#
|
#
|
||||||
sub initialize_package_globals( $$$ ) {
|
sub initialize_package_globals( $$$ ) {
|
||||||
Shorewall::Config::initialize($family, $export, $_[1], $_[2]);
|
Shorewall::Config::initialize($family, $_[1], $_[2]);
|
||||||
Shorewall::Chains::initialize ($family, 1, $export );
|
Shorewall::Chains::initialize ($family, 1, $export );
|
||||||
Shorewall::Zones::initialize ($family, $_[0]);
|
Shorewall::Zones::initialize ($family, $_[0]);
|
||||||
Shorewall::Nat::initialize($family);
|
Shorewall::Nat::initialize($family);
|
||||||
|
@@ -675,7 +675,6 @@ our $debug; # Global debugging flag
|
|||||||
our $confess; # If true, use Carp to report errors with stack trace.
|
our $confess; # If true, use Carp to report errors with stack trace.
|
||||||
|
|
||||||
our $family; # Protocol family (4 or 6)
|
our $family; # Protocol family (4 or 6)
|
||||||
our $export; # True when compiling for export
|
|
||||||
our $toolname; # Name of the tool to use (iptables or iptables6)
|
our $toolname; # Name of the tool to use (iptables or iptables6)
|
||||||
our $toolNAME; # Tool name in CAPS
|
our $toolNAME; # Tool name in CAPS
|
||||||
our $product; # Name of product that will run the generated script
|
our $product; # Name of product that will run the generated script
|
||||||
@@ -789,8 +788,8 @@ sub add_variables( \% );
|
|||||||
# 2. The compiler can run multiple times in the same process so it has to be
|
# 2. The compiler can run multiple times in the same process so it has to be
|
||||||
# able to re-initialize its dependent modules' state.
|
# able to re-initialize its dependent modules' state.
|
||||||
#
|
#
|
||||||
sub initialize( $;$$$) {
|
sub initialize( $;$$) {
|
||||||
( $family, $export, my ( $shorewallrc, $shorewallrc1 ) ) = @_;
|
( $family, my ( $shorewallrc, $shorewallrc1 ) ) = @_;
|
||||||
|
|
||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
( $product, $Product, $toolname, $toolNAME ) = qw( shorewall Shorewall iptables IPTABLES );
|
( $product, $Product, $toolname, $toolNAME ) = qw( shorewall Shorewall iptables IPTABLES );
|
||||||
@@ -5329,13 +5328,7 @@ sub ensure_config_path() {
|
|||||||
fatal_error "CONFIG_PATH not found in $f" unless $config{CONFIG_PATH};
|
fatal_error "CONFIG_PATH not found in $f" unless $config{CONFIG_PATH};
|
||||||
}
|
}
|
||||||
|
|
||||||
my $path = $config{CONFIG_PATH};
|
@config_path = split /:/, $config{CONFIG_PATH};
|
||||||
|
|
||||||
my $chop = ( $path =~ s/^:// );
|
|
||||||
|
|
||||||
@config_path = split /:/, $path;
|
|
||||||
|
|
||||||
shift @config_path if $chop && ( $export || $> != 0 );
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# To accomodate Cygwin-based compilation, we have separate directories for files whose names
|
# To accomodate Cygwin-based compilation, we have separate directories for files whose names
|
||||||
|
@@ -1575,7 +1575,7 @@ sub finish_providers() {
|
|||||||
emit ( " run_ip route replace default scope global table $table \$DEFAULT_ROUTE" );
|
emit ( " run_ip route replace default scope global table $table \$DEFAULT_ROUTE" );
|
||||||
} else {
|
} else {
|
||||||
emit ( " if echo \$DEFAULT_ROUTE | grep -q 'nexthop.+nexthop'; then",
|
emit ( " if echo \$DEFAULT_ROUTE | grep -q 'nexthop.+nexthop'; then",
|
||||||
" while qt \$IP -6 route delete default table $table; do true; done",
|
" qt \$IP -6 route delete default scope global table $table \$DEFAULT_ROUTE",
|
||||||
" run_ip route add default scope global table $table \$DEFAULT_ROUTE",
|
" run_ip route add default scope global table $table \$DEFAULT_ROUTE",
|
||||||
' else',
|
' else',
|
||||||
" run_ip route replace default scope global table $table \$DEFAULT_ROUTE",
|
" run_ip route replace default scope global table $table \$DEFAULT_ROUTE",
|
||||||
@@ -1638,7 +1638,7 @@ sub finish_providers() {
|
|||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
emit( " run_ip route replace default scope global table $default \$FALLBACK_ROUTE" );
|
emit( " run_ip route replace default scope global table $default \$FALLBACK_ROUTE" );
|
||||||
} else {
|
} else {
|
||||||
emit( " while qt \$IP -6 route delete default table $default; do true; done" );
|
emit( " run_ip route delete default scope global table $default \$FALLBACK_ROUTE" );
|
||||||
emit( " run_ip route add default scope global table $default \$FALLBACK_ROUTE" );
|
emit( " run_ip route add default scope global table $default \$FALLBACK_ROUTE" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -96,7 +96,7 @@ use constant { NULL_SECTION => 0x00,
|
|||||||
INVALID_SECTION => 0x10,
|
INVALID_SECTION => 0x10,
|
||||||
UNTRACKED_SECTION => 0x20,
|
UNTRACKED_SECTION => 0x20,
|
||||||
NEW_SECTION => 0x40,
|
NEW_SECTION => 0x40,
|
||||||
POLICYACTION_SECTION => 0x80 };
|
DEFAULTACTION_SECTION => 0x80 };
|
||||||
#
|
#
|
||||||
# Number of elements in the action tuple
|
# Number of elements in the action tuple
|
||||||
#
|
#
|
||||||
@@ -927,28 +927,6 @@ sub process_policies()
|
|||||||
#
|
#
|
||||||
sub process_inline ($$$$$$$$$$$$$$$$$$$$$$);
|
sub process_inline ($$$$$$$$$$$$$$$$$$$$$$);
|
||||||
|
|
||||||
#
|
|
||||||
# Determine the protocol to be used in the jump to the passed action
|
|
||||||
#
|
|
||||||
sub determine_action_protocol( $$ ) {
|
|
||||||
my ( $action, $proto ) = @_;
|
|
||||||
|
|
||||||
if ( my $actionproto = $actions{$action}{proto} ) {
|
|
||||||
if ( $proto eq '-' ) {
|
|
||||||
$proto = $actionproto;
|
|
||||||
} else {
|
|
||||||
if ( defined( my $protonum = resolve_proto( $proto ) ) ) {
|
|
||||||
fatal_error( "The $action action is only usable with " . proto_name( $actionproto ) ) unless $actionproto == $protonum;
|
|
||||||
$proto = $protonum;
|
|
||||||
} else {
|
|
||||||
fatal_error( "Unknown protocol ($proto)" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$proto;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub add_policy_rules( $$$$$ ) {
|
sub add_policy_rules( $$$$$ ) {
|
||||||
my ( $chainref , $target, $loglevel, $pactions, $dropmulticast ) = @_;
|
my ( $chainref , $target, $loglevel, $pactions, $dropmulticast ) = @_;
|
||||||
|
|
||||||
@@ -964,16 +942,12 @@ sub add_policy_rules( $$$$$ ) {
|
|||||||
|
|
||||||
if ( ( $targets{$action} || 0 ) & ACTION ) {
|
if ( ( $targets{$action} || 0 ) & ACTION ) {
|
||||||
#
|
#
|
||||||
# Policy action is a regular action -- jump to the action chain
|
# Default action is a regular action -- jump to the action chain
|
||||||
#
|
#
|
||||||
if ( ( my $proto = determine_action_protocol( $action, '-' ) ) ne '-' ) {
|
add_ijump $chainref, j => use_policy_action( $paction, $chainref->{name} );
|
||||||
add_ijump( $chainref, j => use_policy_action( $paction, $chainref->{name} ), p => $proto );
|
|
||||||
} else {
|
|
||||||
add_ijump $chainref, j => use_policy_action( $paction, $chainref->{name} );
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
#
|
#
|
||||||
# Policy action is an inline
|
# Default action is an inline
|
||||||
#
|
#
|
||||||
( undef, my $level ) = split /:/, $paction, 2;
|
( undef, my $level ) = split /:/, $paction, 2;
|
||||||
( $action, my $param ) = get_target_param( $action );
|
( $action, my $param ) = get_target_param( $action );
|
||||||
@@ -1288,7 +1262,7 @@ sub finish_chain_section ($$$) {
|
|||||||
if ( $chain1ref->{is_policy} ) {
|
if ( $chain1ref->{is_policy} ) {
|
||||||
if ( $chain1ref->{synparams} ) {
|
if ( $chain1ref->{synparams} ) {
|
||||||
my $synchainref = ensure_chain 'filter', syn_flood_chain $chain1ref;
|
my $synchainref = ensure_chain 'filter', syn_flood_chain $chain1ref;
|
||||||
if ( $section == POLICYACTION_SECTION ) {
|
if ( $section == DEFAULTACTION_SECTION ) {
|
||||||
if ( $chain1ref->{policy} =~ /^(ACCEPT|CONTINUE|QUEUE|NFQUEUE)/ ) {
|
if ( $chain1ref->{policy} =~ /^(ACCEPT|CONTINUE|QUEUE|NFQUEUE)/ ) {
|
||||||
add_ijump $chain1ref, j => $synchainref, p => 'tcp --syn';
|
add_ijump $chain1ref, j => $synchainref, p => 'tcp --syn';
|
||||||
}
|
}
|
||||||
@@ -1324,7 +1298,7 @@ sub ensure_rules_chain( $ )
|
|||||||
$chainref = new_rules_chain( $chain ) unless $chainref;
|
$chainref = new_rules_chain( $chain ) unless $chainref;
|
||||||
|
|
||||||
unless ( $chainref->{referenced} ) {
|
unless ( $chainref->{referenced} ) {
|
||||||
if ( $section & ( NEW_SECTION | POLICYACTION_SECTION ) ) {
|
if ( $section & ( NEW_SECTION | DEFAULTACTION_SECTION ) ) {
|
||||||
finish_chain_section $chainref , $chainref, 'ESTABLISHED,RELATED,INVALID,UNTRACKED';
|
finish_chain_section $chainref , $chainref, 'ESTABLISHED,RELATED,INVALID,UNTRACKED';
|
||||||
} elsif ( $section == UNTRACKED_SECTION ) {
|
} elsif ( $section == UNTRACKED_SECTION ) {
|
||||||
finish_chain_section $chainref , $chainref, 'ESTABLISHED,RELATED,INVALID';
|
finish_chain_section $chainref , $chainref, 'ESTABLISHED,RELATED,INVALID';
|
||||||
@@ -1443,13 +1417,13 @@ sub external_name( $ ) {
|
|||||||
#
|
#
|
||||||
# Define an Action
|
# Define an Action
|
||||||
#
|
#
|
||||||
sub new_action( $$$$$$ ) {
|
sub new_action( $$$$$ ) {
|
||||||
|
|
||||||
my ( $action , $type, $options , $actionfile , $state, $proto ) = @_;
|
my ( $action , $type, $options , $actionfile , $state ) = @_;
|
||||||
|
|
||||||
fatal_error "Invalid action name($action)" if reserved_name( $action );
|
fatal_error "Invalid action name($action)" if reserved_name( $action );
|
||||||
|
|
||||||
$actions{$action} = { file => $actionfile, actchain => '' , type => $type, options => $options , state => $state, proto => $proto };
|
$actions{$action} = { file => $actionfile, actchain => '' , type => $type, options => $options , state => $state };
|
||||||
|
|
||||||
$targets{$action} = $type;
|
$targets{$action} = $type;
|
||||||
}
|
}
|
||||||
@@ -2075,10 +2049,9 @@ sub process_actions() {
|
|||||||
my $opts = $type == INLINE ? NOLOG_OPT : 0;
|
my $opts = $type == INLINE ? NOLOG_OPT : 0;
|
||||||
|
|
||||||
my $state = '';
|
my $state = '';
|
||||||
my $proto = 0;
|
|
||||||
|
|
||||||
if ( $action =~ /:/ ) {
|
if ( $action =~ /:/ ) {
|
||||||
warning_message 'Policy Actions are now specified in /etc/shorewall/shorewall.conf';
|
warning_message 'Default Actions are now specified in /etc/shorewall/shorewall.conf';
|
||||||
$action =~ s/:.*$//;
|
$action =~ s/:.*$//;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2092,9 +2065,6 @@ sub process_actions() {
|
|||||||
} else {
|
} else {
|
||||||
fatal_error( q(The 'state' option is reserved for use in the actions.std file) );
|
fatal_error( q(The 'state' option is reserved for use in the actions.std file) );
|
||||||
}
|
}
|
||||||
} elsif ( /^proto=(.+)$/ ) {
|
|
||||||
fatal_error "Unknown Protocol ($1)" unless defined( $proto = resolve_proto( $1 ) );
|
|
||||||
fatal_error "A protocol may not be specified on the REJECT_ACTION ($action)" if $action eq $config{REJECT_ACTION};
|
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Invalid option ($_)" unless $options{$_};
|
fatal_error "Invalid option ($_)" unless $options{$_};
|
||||||
$opts |= $options{$_};
|
$opts |= $options{$_};
|
||||||
@@ -2115,11 +2085,9 @@ sub process_actions() {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
$proto = $actions{$action}{proto} unless $proto;
|
|
||||||
delete $actions{$action};
|
delete $actions{$action};
|
||||||
delete $targets{$action};
|
delete $targets{$action};
|
||||||
} elsif ( ( $actiontype & INLINE ) && ( $type == ACTION ) && $opts & NOINLINE_OPT ) {
|
} elsif ( ( $actiontype & INLINE ) && ( $type == ACTION ) && $opts & NOINLINE_OPT ) {
|
||||||
$proto = $actions{$action}{proto} unless $proto;
|
|
||||||
delete $actions{$action};
|
delete $actions{$action};
|
||||||
delete $targets{$action};
|
delete $targets{$action};
|
||||||
} else {
|
} else {
|
||||||
@@ -2129,8 +2097,6 @@ sub process_actions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $opts & BUILTIN_OPT ) {
|
if ( $opts & BUILTIN_OPT ) {
|
||||||
warning_message( "The 'proto' option has no effect when specified on a builtin action" ) if $proto;
|
|
||||||
|
|
||||||
my $actiontype = USERBUILTIN | OPTIONS;
|
my $actiontype = USERBUILTIN | OPTIONS;
|
||||||
$actiontype |= MANGLE_TABLE if $opts & MANGLE_OPT;
|
$actiontype |= MANGLE_TABLE if $opts & MANGLE_OPT;
|
||||||
$actiontype |= RAW_TABLE if $opts & RAW_OPT;
|
$actiontype |= RAW_TABLE if $opts & RAW_OPT;
|
||||||
@@ -2163,7 +2129,7 @@ sub process_actions() {
|
|||||||
|
|
||||||
fatal_error "Missing Action File ($actionfile)" unless -f $actionfile;
|
fatal_error "Missing Action File ($actionfile)" unless -f $actionfile;
|
||||||
|
|
||||||
new_action ( $action, $type, $opts, $actionfile , $state , $proto );
|
new_action ( $action, $type, $opts, $actionfile , $state );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2201,7 +2167,7 @@ sub process_reject_action() {
|
|||||||
#
|
#
|
||||||
# This gets called very early in the compilation process so we fake the section
|
# This gets called very early in the compilation process so we fake the section
|
||||||
#
|
#
|
||||||
$section = POLICYACTION_SECTION;
|
$section = DEFAULTACTION_SECTION;
|
||||||
|
|
||||||
if ( ( $targets{$action} || 0 ) == ACTION ) {
|
if ( ( $targets{$action} || 0 ) == ACTION ) {
|
||||||
add_ijump $rejectref, j => use_policy_action( $action, $rejectref->{name} );
|
add_ijump $rejectref, j => use_policy_action( $action, $rejectref->{name} );
|
||||||
@@ -2535,7 +2501,7 @@ sub verify_audit($;$$) {
|
|||||||
# the target is a macro, the macro is expanded and this function is called recursively for each rule in the expansion.
|
# the target is a macro, the macro is expanded and this function is called recursively for each rule in the expansion.
|
||||||
# Similarly, if a new action tuple is encountered, this function is called recursively for each rule in the action
|
# Similarly, if a new action tuple is encountered, this function is called recursively for each rule in the action
|
||||||
# body. In this latter case, a reference to the tuple's chain is passed in the first ($chainref) argument. A chain
|
# body. In this latter case, a reference to the tuple's chain is passed in the first ($chainref) argument. A chain
|
||||||
# reference is also passed when rules are being generated during processing of a macro used as a policy action.
|
# reference is also passed when rules are being generated during processing of a macro used as a default action.
|
||||||
#
|
#
|
||||||
|
|
||||||
sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
||||||
@@ -3046,10 +3012,6 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
my $actionchain; # Name of the action chain
|
my $actionchain; # Name of the action chain
|
||||||
|
|
||||||
if ( $actiontype & ACTION ) {
|
if ( $actiontype & ACTION ) {
|
||||||
#
|
|
||||||
# Verify action 'proto', if any
|
|
||||||
#
|
|
||||||
$proto = determine_action_protocol( $basictarget, $proto );
|
|
||||||
#
|
#
|
||||||
# Save NAT-oriented column contents
|
# Save NAT-oriented column contents
|
||||||
#
|
#
|
||||||
@@ -3200,7 +3162,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
unless ( $section & ( NEW_SECTION | POLICYACTION_SECTION ) ||
|
unless ( $section & ( NEW_SECTION | DEFAULTACTION_SECTION ) ||
|
||||||
$inaction ||
|
$inaction ||
|
||||||
$blacklist ||
|
$blacklist ||
|
||||||
$basictarget eq 'dropInvalid' ) {
|
$basictarget eq 'dropInvalid' ) {
|
||||||
@@ -3336,7 +3298,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
$log_action ,
|
$log_action ,
|
||||||
$exceptionrule ,
|
$exceptionrule ,
|
||||||
$usergenerated && ! $loglevel )
|
$usergenerated && ! $loglevel )
|
||||||
unless unreachable_warning( $wildcard || $section == POLICYACTION_SECTION, $chainref );
|
unless unreachable_warning( $wildcard || $section == DEFAULTACTION_SECTION, $chainref );
|
||||||
}
|
}
|
||||||
|
|
||||||
$generated = 1;
|
$generated = 1;
|
||||||
@@ -3414,7 +3376,7 @@ sub check_state( $ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $section & ( NEW_SECTION | POLICYACTION_SECTION ) ) {
|
if ( $section & ( NEW_SECTION | DEFAULTACTION_SECTION ) ) {
|
||||||
if ( $state eq 'NEW' ) {
|
if ( $state eq 'NEW' ) {
|
||||||
#
|
#
|
||||||
# If an INVALID or UNTRACKED rule would be emitted then we must include the state match
|
# If an INVALID or UNTRACKED rule would be emitted then we must include the state match
|
||||||
@@ -3955,7 +3917,7 @@ sub process_rules() {
|
|||||||
#
|
#
|
||||||
# No need to finish the NEW section since no rules need to be generated
|
# No need to finish the NEW section since no rules need to be generated
|
||||||
#
|
#
|
||||||
$section = $next_section = POLICYACTION_SECTION;
|
$section = $next_section = DEFAULTACTION_SECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub process_mangle_inline( $$$$$$$$$$$$$$$$$$$$ ) {
|
sub process_mangle_inline( $$$$$$$$$$$$$$$$$$$$ ) {
|
||||||
@@ -4774,10 +4736,6 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
function => sub() {
|
function => sub() {
|
||||||
fatal_error( qq(Action $cmd may not be used in the mangle file) ) unless $actiontype & MANGLE_TABLE;
|
fatal_error( qq(Action $cmd may not be used in the mangle file) ) unless $actiontype & MANGLE_TABLE;
|
||||||
#
|
#
|
||||||
# Verify action 'proto', if any
|
|
||||||
#
|
|
||||||
$proto = determine_action_protocol( $cmd, $proto );
|
|
||||||
#
|
|
||||||
# Create the action:level:tag:param tuple.
|
# Create the action:level:tag:param tuple.
|
||||||
#
|
#
|
||||||
my $normalized_target = normalize_action( $cmd, '', $params );
|
my $normalized_target = normalize_action( $cmd, '', $params );
|
||||||
@@ -5736,10 +5694,6 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
if ( $actiontype & ACTION ) {
|
if ( $actiontype & ACTION ) {
|
||||||
fatal_error( qq(Action $target may not be used in the snat file) ) unless $actiontype & NAT_TABLE;
|
fatal_error( qq(Action $target may not be used in the snat file) ) unless $actiontype & NAT_TABLE;
|
||||||
#
|
#
|
||||||
# Verify action 'proto', if any
|
|
||||||
#
|
|
||||||
$proto = determine_action_protocol( $target, $proto );
|
|
||||||
#
|
|
||||||
# Create the action:level:tag:param tuple. Since we don't allow logging out of nat POSTROUTING, we store
|
# Create the action:level:tag:param tuple. Since we don't allow logging out of nat POSTROUTING, we store
|
||||||
# the interface name in the log tag
|
# the interface name in the log tag
|
||||||
#
|
#
|
||||||
|
@@ -225,11 +225,11 @@ sub handle_in_bandwidth( $$$ ) {
|
|||||||
if ( have_capability 'BASIC_FILTER' ) {
|
if ( have_capability 'BASIC_FILTER' ) {
|
||||||
if ( $in_rate ) {
|
if ( $in_rate ) {
|
||||||
emit( "run_tc filter add dev $physical parent ffff: protocol all prio 10 basic \\",
|
emit( "run_tc filter add dev $physical parent ffff: protocol all prio 10 basic \\",
|
||||||
" police mpu 64 rate ${in_rate}kbit burst $in_burst drop\n" );
|
" police mpu 64 drop rate ${in_rate}kbit burst $in_burst\n" );
|
||||||
} else {
|
} else {
|
||||||
emit( "run_tc filter add dev $physical parent ffff: protocol all prio 10 \\",
|
emit( "run_tc filter add dev $physical parent ffff: protocol all prio 10 \\",
|
||||||
" estimator $in_interval $in_decay basic \\",
|
" estimator $in_interval $in_decay basic \\",
|
||||||
" police avrate ${in_avrate}kbit drop\n" );
|
" police drop avrate ${in_avrate}kbit\n" );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
emit( "run_tc filter add dev $physical parent ffff: protocol all prio 10 \\" ,
|
emit( "run_tc filter add dev $physical parent ffff: protocol all prio 10 \\" ,
|
||||||
|
@@ -90,6 +90,7 @@ our @EXPORT = ( qw( NOTHING
|
|||||||
interface_is_optional
|
interface_is_optional
|
||||||
interface_is_required
|
interface_is_required
|
||||||
find_interfaces_by_option
|
find_interfaces_by_option
|
||||||
|
find_interfaces_by_option1
|
||||||
get_interface_option
|
get_interface_option
|
||||||
get_interface_origin
|
get_interface_origin
|
||||||
interface_has_option
|
interface_has_option
|
||||||
@@ -252,17 +253,6 @@ use constant { NO_UPDOWN => 1,
|
|||||||
|
|
||||||
our %validinterfaceoptions;
|
our %validinterfaceoptions;
|
||||||
|
|
||||||
our %procinterfaceoptions=( accept_ra => 1,
|
|
||||||
arp_filter => 1,
|
|
||||||
arp_ignore => 1,
|
|
||||||
forward => 1,
|
|
||||||
logmartians => 1,
|
|
||||||
proxyarp => 1,
|
|
||||||
proxyndp => 1,
|
|
||||||
routefilter => 1,
|
|
||||||
sourceroute => 1,
|
|
||||||
);
|
|
||||||
|
|
||||||
our %prohibitunmanaged = (
|
our %prohibitunmanaged = (
|
||||||
blacklist => 1,
|
blacklist => 1,
|
||||||
bridge => 1,
|
bridge => 1,
|
||||||
@@ -327,7 +317,7 @@ sub initialize( $$ ) {
|
|||||||
%mapbase = ();
|
%mapbase = ();
|
||||||
%mapbase1 = ();
|
%mapbase1 = ();
|
||||||
$baseseq = 0;
|
$baseseq = 0;
|
||||||
$minroot = undef;
|
$minroot = 0;
|
||||||
$loopback_interface = '';
|
$loopback_interface = '';
|
||||||
|
|
||||||
%validzoneoptions = ( mss => NUMERIC,
|
%validzoneoptions = ( mss => NUMERIC,
|
||||||
@@ -349,7 +339,7 @@ sub initialize( $$ ) {
|
|||||||
arp_ignore => ENUM_IF_OPTION,
|
arp_ignore => ENUM_IF_OPTION,
|
||||||
blacklist => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
blacklist => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
||||||
bridge => SIMPLE_IF_OPTION,
|
bridge => SIMPLE_IF_OPTION,
|
||||||
dbl => ENUM_IF_OPTION + IF_OPTION_WILDOK,
|
dbl => ENUM_IF_OPTION,
|
||||||
destonly => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
destonly => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
||||||
detectnets => OBSOLETE_IF_OPTION,
|
detectnets => OBSOLETE_IF_OPTION,
|
||||||
dhcp => SIMPLE_IF_OPTION,
|
dhcp => SIMPLE_IF_OPTION,
|
||||||
@@ -373,9 +363,9 @@ sub initialize( $$ ) {
|
|||||||
upnp => SIMPLE_IF_OPTION,
|
upnp => SIMPLE_IF_OPTION,
|
||||||
upnpclient => SIMPLE_IF_OPTION,
|
upnpclient => SIMPLE_IF_OPTION,
|
||||||
mss => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
mss => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
||||||
physical => STRING_IF_OPTION + IF_OPTION_HOST + IF_OPTION_WILDOK,
|
physical => STRING_IF_OPTION + IF_OPTION_HOST,
|
||||||
unmanaged => SIMPLE_IF_OPTION,
|
unmanaged => SIMPLE_IF_OPTION,
|
||||||
wait => NUMERIC_IF_OPTION,
|
wait => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
||||||
);
|
);
|
||||||
%validhostoptions = (
|
%validhostoptions = (
|
||||||
blacklist => 1,
|
blacklist => 1,
|
||||||
@@ -400,7 +390,7 @@ sub initialize( $$ ) {
|
|||||||
%validinterfaceoptions = ( accept_ra => NUMERIC_IF_OPTION,
|
%validinterfaceoptions = ( accept_ra => NUMERIC_IF_OPTION,
|
||||||
blacklist => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
blacklist => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
||||||
bridge => SIMPLE_IF_OPTION,
|
bridge => SIMPLE_IF_OPTION,
|
||||||
dbl => ENUM_IF_OPTION + IF_OPTION_WILDOK,
|
dbl => ENUM_IF_OPTION,
|
||||||
destonly => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
destonly => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
||||||
dhcp => SIMPLE_IF_OPTION,
|
dhcp => SIMPLE_IF_OPTION,
|
||||||
ignore => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
ignore => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
||||||
@@ -412,18 +402,18 @@ sub initialize( $$ ) {
|
|||||||
optional => SIMPLE_IF_OPTION,
|
optional => SIMPLE_IF_OPTION,
|
||||||
proxyndp => BINARY_IF_OPTION,
|
proxyndp => BINARY_IF_OPTION,
|
||||||
required => SIMPLE_IF_OPTION,
|
required => SIMPLE_IF_OPTION,
|
||||||
routeback => BINARY_IF_OPTION + IF_OPTION_ZONEONLY + IF_OPTION_HOST + IF_OPTION_VSERVER + IF_OPTION_WILDOK,
|
routeback => BINARY_IF_OPTION + IF_OPTION_ZONEONLY + IF_OPTION_HOST + IF_OPTION_VSERVER,
|
||||||
rpfilter => SIMPLE_IF_OPTION,
|
rpfilter => SIMPLE_IF_OPTION,
|
||||||
sfilter => IPLIST_IF_OPTION,
|
sfilter => IPLIST_IF_OPTION,
|
||||||
sourceroute => BINARY_IF_OPTION,
|
sourceroute => BINARY_IF_OPTION,
|
||||||
tcpflags => BINARY_IF_OPTION + IF_OPTION_HOST,
|
tcpflags => BINARY_IF_OPTION + IF_OPTION_HOST,
|
||||||
mss => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
mss => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
||||||
forward => BINARY_IF_OPTION,
|
forward => BINARY_IF_OPTION,
|
||||||
physical => STRING_IF_OPTION + IF_OPTION_HOST + IF_OPTION_WILDOK,
|
physical => STRING_IF_OPTION + IF_OPTION_HOST,
|
||||||
unmanaged => SIMPLE_IF_OPTION,
|
unmanaged => SIMPLE_IF_OPTION,
|
||||||
upnp => SIMPLE_IF_OPTION,
|
upnp => SIMPLE_IF_OPTION,
|
||||||
upnpclient => SIMPLE_IF_OPTION,
|
upnpclient => SIMPLE_IF_OPTION,
|
||||||
wait => NUMERIC_IF_OPTION,
|
wait => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
||||||
);
|
);
|
||||||
%validhostoptions = (
|
%validhostoptions = (
|
||||||
blacklist => 1,
|
blacklist => 1,
|
||||||
@@ -724,7 +714,7 @@ sub interface_match( $$ ) {
|
|||||||
return 1 if $piface eq $cifaceref->{bridge};
|
return 1 if $piface eq $cifaceref->{bridge};
|
||||||
return 1 if $ciface eq $pifaceref->{bridge};
|
return 1 if $ciface eq $pifaceref->{bridge};
|
||||||
|
|
||||||
if ( defined $minroot ) {
|
if ( $minroot ) {
|
||||||
if ( $piface =~ /\+$/ ) {
|
if ( $piface =~ /\+$/ ) {
|
||||||
my $root = $pifaceref->{root};
|
my $root = $pifaceref->{root};
|
||||||
my $rlength = length( $root );
|
my $rlength = length( $root );
|
||||||
@@ -1214,16 +1204,15 @@ sub process_interface( $$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $wildcard = 0;
|
my $wildcard = 0;
|
||||||
my $physwild = 0;
|
|
||||||
my $root;
|
my $root;
|
||||||
|
|
||||||
if ( $interface =~ /\+$/ ) {
|
if ( $interface =~ /\+$/ ) {
|
||||||
$wildcard = $physwild = 1; # Default physical name is the logical name
|
$wildcard = 1;
|
||||||
$root = substr( $interface, 0, -1 );
|
$root = substr( $interface, 0, -1 );
|
||||||
$roots{$root} = $interface;
|
$roots{$root} = $interface;
|
||||||
my $len = length $root;
|
my $len = length $root;
|
||||||
|
|
||||||
if ( defined $minroot ) {
|
if ( $minroot ) {
|
||||||
$minroot = $len if $minroot > $len;
|
$minroot = $len if $minroot > $len;
|
||||||
} else {
|
} else {
|
||||||
$minroot = $len;
|
$minroot = $len;
|
||||||
@@ -1269,6 +1258,8 @@ sub process_interface( $$ ) {
|
|||||||
my %hostoptions = ( dynamic => 0 );
|
my %hostoptions = ( dynamic => 0 );
|
||||||
|
|
||||||
for my $option (split_list1 $options, 'option' ) {
|
for my $option (split_list1 $options, 'option' ) {
|
||||||
|
next if $option eq '-';
|
||||||
|
|
||||||
( $option, my $value ) = split /=/, $option;
|
( $option, my $value ) = split /=/, $option;
|
||||||
|
|
||||||
fatal_error "Invalid Interface option ($option)" unless my $type = $validinterfaceoptions{$option};
|
fatal_error "Invalid Interface option ($option)" unless my $type = $validinterfaceoptions{$option};
|
||||||
@@ -1305,6 +1296,7 @@ sub process_interface( $$ ) {
|
|||||||
} elsif ( $type == BINARY_IF_OPTION ) {
|
} elsif ( $type == BINARY_IF_OPTION ) {
|
||||||
$value = 1 unless defined $value;
|
$value = 1 unless defined $value;
|
||||||
fatal_error "Option value for '$option' must be 0 or 1" unless ( $value eq '0' || $value eq '1' );
|
fatal_error "Option value for '$option' must be 0 or 1" unless ( $value eq '0' || $value eq '1' );
|
||||||
|
fatal_error "The '$option' option may not be used with a wild-card interface name" if $wildcard && ! $type && IF_OPTION_WILDOK;
|
||||||
$options{$option} = $value;
|
$options{$option} = $value;
|
||||||
$hostoptions{$option} = $value if $hostopt;
|
$hostoptions{$option} = $value if $hostopt;
|
||||||
} elsif ( $type == ENUM_IF_OPTION ) {
|
} elsif ( $type == ENUM_IF_OPTION ) {
|
||||||
@@ -1328,6 +1320,7 @@ sub process_interface( $$ ) {
|
|||||||
assert( 0 );
|
assert( 0 );
|
||||||
}
|
}
|
||||||
} elsif ( $type == NUMERIC_IF_OPTION ) {
|
} elsif ( $type == NUMERIC_IF_OPTION ) {
|
||||||
|
fatal_error "The '$option' option may not be specified on a wildcard interface" if $wildcard && ! $type && IF_OPTION_WILDOK;
|
||||||
$value = $defaultinterfaceoptions{$option} unless defined $value;
|
$value = $defaultinterfaceoptions{$option} unless defined $value;
|
||||||
fatal_error "The '$option' option requires a value" unless defined $value;
|
fatal_error "The '$option' option requires a value" unless defined $value;
|
||||||
my $numval = numeric_value $value;
|
my $numval = numeric_value $value;
|
||||||
@@ -1379,9 +1372,7 @@ sub process_interface( $$ ) {
|
|||||||
|
|
||||||
fatal_error "Duplicate physical interface name ($value)" if ( $interfaces{$value} && ! $port );
|
fatal_error "Duplicate physical interface name ($value)" if ( $interfaces{$value} && ! $port );
|
||||||
|
|
||||||
$physwild = ( $value =~ /\+$/ );
|
fatal_error "The type of 'physical' name ($value) doesn't match the type of interface name ($interface)" if $wildcard && ! $value =~ /\+$/;
|
||||||
fatal_error "The type of 'physical' name ($value) doesn't match the type of interface name ($interface)" if $wildcard && ! $physwild;
|
|
||||||
|
|
||||||
$physical = $value;
|
$physical = $value;
|
||||||
} else {
|
} else {
|
||||||
assert(0);
|
assert(0);
|
||||||
@@ -1409,14 +1400,6 @@ sub process_interface( $$ ) {
|
|||||||
$options{ignore} = 0;
|
$options{ignore} = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for my $option ( keys %options ) {
|
|
||||||
if ( $root ) {
|
|
||||||
warning_message( "The '$option' option is ignored when used with a wildcard physical name" ) if $physwild && $procinterfaceoptions{$option};
|
|
||||||
} else {
|
|
||||||
warning_message( "The '$option' option is ignored when used with interface name '+'" ) unless $validinterfaceoptions{$option} & IF_OPTION_WILDOK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $netsref eq 'dynamic' ) {
|
if ( $netsref eq 'dynamic' ) {
|
||||||
my $ipset = $family == F_IPV4 ? "${zone}" : "6_${zone}";
|
my $ipset = $family == F_IPV4 ? "${zone}" : "6_${zone}";
|
||||||
$ipset = join( '_', $ipset, var_base1( $physical ) ) unless $zoneref->{options}{in_out}{dynamic_shared};
|
$ipset = join( '_', $ipset, var_base1( $physical ) ) unless $zoneref->{options}{in_out}{dynamic_shared};
|
||||||
@@ -1475,7 +1458,6 @@ sub process_interface( $$ ) {
|
|||||||
zones => {},
|
zones => {},
|
||||||
origin => shortlineinfo( '' ),
|
origin => shortlineinfo( '' ),
|
||||||
wildcard => $wildcard,
|
wildcard => $wildcard,
|
||||||
physwild => $physwild, # Currently unused
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$interfaces{$physical} = $interfaceref if $physical ne $interface;
|
$interfaces{$physical} = $interfaceref if $physical ne $interface;
|
||||||
@@ -1634,7 +1616,7 @@ sub known_interface($)
|
|||||||
|
|
||||||
my $iface = $interface;
|
my $iface = $interface;
|
||||||
|
|
||||||
if ( defined $minroot ) {
|
if ( $minroot ) {
|
||||||
#
|
#
|
||||||
# We have wildcard interfaces -- see if this interface matches one of their roots
|
# We have wildcard interfaces -- see if this interface matches one of their roots
|
||||||
#
|
#
|
||||||
@@ -1875,8 +1857,7 @@ sub find_interfaces_by_option( $;$ ) {
|
|||||||
for my $interface ( @interfaces ) {
|
for my $interface ( @interfaces ) {
|
||||||
my $interfaceref = $interfaces{$interface};
|
my $interfaceref = $interfaces{$interface};
|
||||||
|
|
||||||
next unless $interfaceref->{root}; # Don't return '+' interface
|
next unless $interfaceref->{root};
|
||||||
next if $procinterfaceoptions{$option} && $interfaceref->{physwild}; # Ignore /proc options on wildcard interface
|
|
||||||
|
|
||||||
my $optionsref = $interfaceref->{options};
|
my $optionsref = $interfaceref->{options};
|
||||||
if ( $nonzero ) {
|
if ( $nonzero ) {
|
||||||
@@ -1891,6 +1872,35 @@ sub find_interfaces_by_option( $;$ ) {
|
|||||||
\@ints;
|
\@ints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Returns reference to array of interfaces with the passed option. Unlike the preceding function, this one:
|
||||||
|
#
|
||||||
|
# - All entries in %interfaces are searched.
|
||||||
|
# - Returns a two-element list; the second element indicates whether any members of the list have wildcard physical names
|
||||||
|
#
|
||||||
|
sub find_interfaces_by_option1( $ ) {
|
||||||
|
my $option = $_[0];
|
||||||
|
my @ints = ();
|
||||||
|
my $wild = 0;
|
||||||
|
|
||||||
|
for my $interface ( @interfaces ) {
|
||||||
|
my $interfaceref = $interfaces{$interface};
|
||||||
|
|
||||||
|
next unless defined $interfaceref->{physical};
|
||||||
|
|
||||||
|
my $optionsref = $interfaceref->{options};
|
||||||
|
|
||||||
|
if ( $optionsref && defined $optionsref->{$option} ) {
|
||||||
|
$wild ||= $interfaceref->{wildcard};
|
||||||
|
push @ints , $interface
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return unless defined wantarray;
|
||||||
|
|
||||||
|
wantarray ? ( \@ints, $wild ) : \@ints;
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Return the value of an option for an interface
|
# Return the value of an option for an interface
|
||||||
#
|
#
|
||||||
|
@@ -268,10 +268,8 @@ case "$COMMAND" in
|
|||||||
error_message "$g_product is not running"
|
error_message "$g_product is not running"
|
||||||
status=2
|
status=2
|
||||||
elif [ $# -eq 1 ]; then
|
elif [ $# -eq 1 ]; then
|
||||||
for table in raw mangle nat filter; do
|
$g_tool -Z
|
||||||
qt $g_tool -t $table -Z
|
$g_tool -t mangle -Z
|
||||||
done
|
|
||||||
|
|
||||||
date > ${VARDIR}/restarted
|
date > ${VARDIR}/restarted
|
||||||
status=0
|
status=0
|
||||||
progress_message3 "$g_product Counters Reset"
|
progress_message3 "$g_product Counters Reset"
|
||||||
|
@@ -77,7 +77,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
|
|
||||||
ARPTABLES=
|
ARPTABLES=
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
CONFIG_PATH="${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
|
@@ -88,7 +88,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
|
|
||||||
ARPTABLES=
|
ARPTABLES=
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
CONFIG_PATH="${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
|
@@ -85,7 +85,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
|
|
||||||
ARPTABLES=
|
ARPTABLES=
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
CONFIG_PATH="${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
|
@@ -88,7 +88,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
|
|
||||||
ARPTABLES=
|
ARPTABLES=
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
CONFIG_PATH="${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
|
@@ -26,19 +26,18 @@ Broadcast inline,audit # Handles Broadcast/Anycast
|
|||||||
?else
|
?else
|
||||||
Broadcast noinline,audit # Handles Broadcast/Anycast
|
Broadcast noinline,audit # Handles Broadcast/Anycast
|
||||||
?endif
|
?endif
|
||||||
DNSAmp proto=17 # Matches one-question recursive DNS queries
|
DNSAmp # Matches one-question recursive DNS queries
|
||||||
Drop # Default Action for DROP policy (deprecated)
|
Drop # Default Action for DROP policy (deprecated)
|
||||||
dropBcast inline # Silently Drop Broadcast
|
dropBcast inline # Silently Drop Broadcast
|
||||||
dropBcasts inline # Silently Drop Broadcast
|
dropBcasts inline # Silently Drop Broadcast
|
||||||
dropInvalid inline # Drops packets in the INVALID conntrack state
|
dropInvalid inline # Drops packets in the INVALID conntrack state
|
||||||
dropMcast inline # Silently Drop Multicast
|
dropMcast inline # Silently Drop Multicast
|
||||||
dropNotSyn noinline,proto=6 # Silently Drop Non-syn TCP packets
|
dropNotSyn noinline # Silently Drop Non-syn TCP packets
|
||||||
DropDNSrep inline,proto=17 # Drops DNS replies
|
DropDNSrep inline # Drops DNS replies
|
||||||
DropSmurfs noinline # Drop smurf packets
|
DropSmurfs noinline # Drop smurf packets
|
||||||
Established inline,\ # Handles packets in the ESTABLISHED state
|
Established inline,\ # Handles packets in the ESTABLISHED state
|
||||||
state=ESTABLISHED #
|
state=ESTABLISHED #
|
||||||
FIN inline,audit,\ # Handles ACK,FIN packets
|
FIN inline,audit # Handles ACK,FIN,PSH packets
|
||||||
proto=6
|
|
||||||
forwardUPnP noinline # Allow traffic that upnpd has redirected from 'upnp' interfaces.
|
forwardUPnP noinline # Allow traffic that upnpd has redirected from 'upnp' interfaces.
|
||||||
GlusterFS inline # Handles GlusterFS
|
GlusterFS inline # Handles GlusterFS
|
||||||
IfEvent noinline # Perform an action based on an event
|
IfEvent noinline # Perform an action based on an event
|
||||||
@@ -51,16 +50,14 @@ Multicast inline,audit # Handles Multicast
|
|||||||
Multicast noinline,audit # Handles Multicast
|
Multicast noinline,audit # Handles Multicast
|
||||||
?endif
|
?endif
|
||||||
New inline,state=NEW # Handles packets in the NEW conntrack state
|
New inline,state=NEW # Handles packets in the NEW conntrack state
|
||||||
NotSyn inline,audit,\ # Handles TCP packets which do not have SYN=1 and ACK=0
|
NotSyn inline,audit # Handles TCP packets which do not have SYN=1 and ACK=0
|
||||||
proto=6
|
rejNotSyn noinline # Silently Reject Non-syn TCP packets
|
||||||
rejNotSyn noinline,proto=6 # Silently Reject Non-syn TCP packets
|
|
||||||
Reject # Default Action for REJECT policy (deprecated)
|
Reject # Default Action for REJECT policy (deprecated)
|
||||||
Related inline,\ # Handles packets in the RELATED conntrack state
|
Related inline,\ # Handles packets in the RELATED conntrack state
|
||||||
state=RELATED #
|
state=RELATED #
|
||||||
ResetEvent inline # Reset an Event
|
ResetEvent inline # Reset an Event
|
||||||
RST inline,audit,\ # Handle packets with RST set
|
RST inline,audit # Handle packets with RST set
|
||||||
proto=6
|
|
||||||
SetEvent inline # Initialize an event
|
SetEvent inline # Initialize an event
|
||||||
TCPFlags proto=6 # Handle bad flag combinations.
|
TCPFlags # Handle bad flag combinations.
|
||||||
Untracked inline,\ # Handles packets in the UNTRACKED conntrack state
|
Untracked inline,\ # Handles packets in the UNTRACKED conntrack state
|
||||||
state=UNTRACKED #
|
state=UNTRACKED #
|
||||||
|
@@ -77,7 +77,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
|
|
||||||
ARPTABLES=
|
ARPTABLES=
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
CONFIG_PATH="${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
|
@@ -3,4 +3,4 @@
|
|||||||
#
|
#
|
||||||
# /usr/share/shorewall/configpath
|
# /usr/share/shorewall/configpath
|
||||||
#
|
#
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -191,27 +191,6 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>proto</option>=<replaceable>protocol</replaceable></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Added in Shorewall 5.1.10. Specifies that the action is
|
|
||||||
only usable with the specified
|
|
||||||
<replaceable>protocol</replaceable> (name or number). When the
|
|
||||||
action is invoked with no protocol specified in the PROTO
|
|
||||||
column, or if the action is used as a Policy Action, the named
|
|
||||||
<replaceable>protocol</replaceable> will be assumed. If a
|
|
||||||
protocol is specified in the PROTO column of an invocation,
|
|
||||||
then it must match the named
|
|
||||||
<replaceable>protocol</replaceable>.</para>
|
|
||||||
|
|
||||||
<para>The <option>proto</option> option has no effect if the
|
|
||||||
<option>inline</option> or <option>builtin</option> option is
|
|
||||||
specified. A warning is issued if <option>proto</option> is
|
|
||||||
specified along with <option>builtin</option>.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>section</option></term>
|
<term><option>section</option></term>
|
||||||
|
|
||||||
|
@@ -447,7 +447,7 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>This form combines the preceding two and requires that
|
<para>This form combines the preceding two and requires that
|
||||||
both the incoming interface and source address match.</para>
|
both the incoming interace and source address match.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -543,7 +543,7 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>This form combines the preceding two and requires that
|
<para>This form combines the preceding two and requires that
|
||||||
both the outgoing interface and destination address
|
both the outgoing interace and destination address
|
||||||
match.</para>
|
match.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@@ -112,10 +112,7 @@ loc eth2 -</programlisting>
|
|||||||
url="/manpages/shorewall-nesting.html">shorewall-nesting</ulink>(5)
|
url="/manpages/shorewall-nesting.html">shorewall-nesting</ulink>(5)
|
||||||
for a discussion of this problem.</para>
|
for a discussion of this problem.</para>
|
||||||
|
|
||||||
<para>Shorewall allows '+' as an interface name, but that usage is
|
<para>Shorewall allows '+' as an interface name.</para>
|
||||||
deprecated. A better approach is to specify
|
|
||||||
'<option>physical</option>=+' in the OPTIONS column (see
|
|
||||||
below).</para>
|
|
||||||
|
|
||||||
<para>There is no need to define the loopback interface (lo) in this
|
<para>There is no need to define the loopback interface (lo) in this
|
||||||
file.</para>
|
file.</para>
|
||||||
@@ -196,54 +193,6 @@ loc eth2 -</programlisting>
|
|||||||
should have no embedded white-space.</para>
|
should have no embedded white-space.</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis
|
|
||||||
role="bold">accept_ra</emphasis>[={0|1|2}]</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>IPv6 only; added in Shorewall 4.5.16. Values are:</para>
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>0</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Do not accept Router Advertisements.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>1</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Accept Route Advertisements if forwarding is
|
|
||||||
disabled.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>2</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Overrule forwarding behavior. Accept Route
|
|
||||||
Advertisements even if forwarding is enabled.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
|
|
||||||
<para>If the option is specified without a value, then the
|
|
||||||
value 1 is assumed.</para>
|
|
||||||
|
|
||||||
<note>
|
|
||||||
<para>This option does not work with a wild-card <emphasis
|
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">arp_filter[={0|1}]</emphasis></term>
|
<term><emphasis role="bold">arp_filter[={0|1}]</emphasis></term>
|
||||||
|
|
||||||
@@ -260,12 +209,12 @@ loc eth2 -</programlisting>
|
|||||||
changed; the value assigned to the setting will be the value
|
changed; the value assigned to the setting will be the value
|
||||||
specified (if any) or 1 if no value is given.</para>
|
specified (if any) or 1 if no value is given.</para>
|
||||||
|
|
||||||
|
<para/>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>This option does not work with a wild-card <emphasis
|
<para>This option does not work with a wild-card
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
<replaceable>interface</replaceable> name (e.g., eth0.+) in
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
the INTERFACE column.</para>
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
</note>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -294,14 +243,16 @@ loc eth2 -</programlisting>
|
|||||||
|
|
||||||
<para>8 - do not reply for all local addresses</para>
|
<para>8 - do not reply for all local addresses</para>
|
||||||
|
|
||||||
|
<para/>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>This option does not work with a wild-card <emphasis
|
<para>This option does not work with a wild-card
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
<replaceable>interface</replaceable> name (e.g., eth0.+) in
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
the INTERFACE column.</para>
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
|
<para/>
|
||||||
|
|
||||||
<warning>
|
<warning>
|
||||||
<para>Do not specify <emphasis
|
<para>Do not specify <emphasis
|
||||||
role="bold">arp_ignore</emphasis> for any interface involved
|
role="bold">arp_ignore</emphasis> for any interface involved
|
||||||
@@ -479,25 +430,6 @@ loc eth2 -</programlisting>
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">forward</emphasis>[={0|1}]</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>IPv6 only Sets the
|
|
||||||
/proc/sys/net/ipv6/conf/interface/forwarding option to the
|
|
||||||
specified value. If no value is supplied, then 1 is
|
|
||||||
assumed.</para>
|
|
||||||
|
|
||||||
<note>
|
|
||||||
<para>This option does not work with a wild-card <emphasis
|
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">ignore[=1]</emphasis></term>
|
<term><emphasis role="bold">ignore[=1]</emphasis></term>
|
||||||
|
|
||||||
@@ -564,11 +496,9 @@ loc eth2 -</programlisting>
|
|||||||
<para/>
|
<para/>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>This option does not work with a wild-card <emphasis
|
<para>This option does not work with a wild-card
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
<replaceable>interface</replaceable> name (e.g., eth0.+) in
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
the INTERFACE column.</para>
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@@ -695,10 +625,7 @@ loc eth2 -</programlisting>
|
|||||||
|
|
||||||
<para>If the <emphasis>interface</emphasis> name is a wildcard
|
<para>If the <emphasis>interface</emphasis> name is a wildcard
|
||||||
name (ends with '+'), then the physical
|
name (ends with '+'), then the physical
|
||||||
<emphasis>name</emphasis> must also end in '+'. The physical
|
<emphasis>name</emphasis> must also end in '+'.</para>
|
||||||
<replaceable>name</replaceable> may end in '+' (or be exactly
|
|
||||||
'+') when the <replaceable>interface</replaceable> name is not
|
|
||||||
a wildcard name.</para>
|
|
||||||
|
|
||||||
<para>If <option>physical</option> is not specified, then it's
|
<para>If <option>physical</option> is not specified, then it's
|
||||||
value defaults to the <emphasis>interface</emphasis>
|
value defaults to the <emphasis>interface</emphasis>
|
||||||
@@ -720,13 +647,9 @@ loc eth2 -</programlisting>
|
|||||||
url="http://tldp.org/HOWTO/Proxy-ARP-Subnet/index.html">http://tldp.org/HOWTO/Proxy-ARP-Subnet/index.html.
|
url="http://tldp.org/HOWTO/Proxy-ARP-Subnet/index.html">http://tldp.org/HOWTO/Proxy-ARP-Subnet/index.html.
|
||||||
</ulink></para>
|
</ulink></para>
|
||||||
|
|
||||||
<note>
|
<para><emphasis role="bold">Note</emphasis>: This option does
|
||||||
<para>This option does not work with a wild-card <emphasis
|
not work with a wild-card <replaceable>interface</replaceable>
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
name (e.g., eth0.+) in the INTERFACE column.</para>
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
|
||||||
|
|
||||||
<para>Only those interfaces with the <option>proxyarp</option>
|
<para>Only those interfaces with the <option>proxyarp</option>
|
||||||
option will have their setting changed; the value assigned to
|
option will have their setting changed; the value assigned to
|
||||||
@@ -742,13 +665,9 @@ loc eth2 -</programlisting>
|
|||||||
<para>IPv6 only. Sets
|
<para>IPv6 only. Sets
|
||||||
/proc/sys/net/ipv6/conf/<emphasis>interface</emphasis>/proxy_ndp.</para>
|
/proc/sys/net/ipv6/conf/<emphasis>interface</emphasis>/proxy_ndp.</para>
|
||||||
|
|
||||||
<note>
|
<para><emphasis role="bold">Note</emphasis>: This option does
|
||||||
<para>This option does not work with a wild-card <emphasis
|
not work with a wild-card <replaceable>interface</replaceable>
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
name (e.g., eth0.+) in the INTERFACE column.</para>
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
|
||||||
|
|
||||||
<para>Only those interfaces with the <option>proxyndp</option>
|
<para>Only those interfaces with the <option>proxyndp</option>
|
||||||
option will have their setting changed; the value assigned to
|
option will have their setting changed; the value assigned to
|
||||||
@@ -812,11 +731,9 @@ loc eth2 -</programlisting>
|
|||||||
filtering.</para>
|
filtering.</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>This option does not work with a wild-card <emphasis
|
<para>This option does not work with a wild-card
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
<replaceable>interface</replaceable> name (e.g., eth0.+) in
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
the INTERFACE column.</para>
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<para>This option can also be enabled globally via the
|
<para>This option can also be enabled globally via the
|
||||||
@@ -925,11 +842,9 @@ loc eth2 -</programlisting>
|
|||||||
specified (if any) or 1 if no value is given.</para>
|
specified (if any) or 1 if no value is given.</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>This option does not work with a wild-card <emphasis
|
<para>This option does not work with a wild-card
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
<replaceable>interface</replaceable> name (e.g., eth0.+) in
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
the INTERFACE column.</para>
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
</note>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@@ -362,7 +362,7 @@ REJECT(icmp-proto-unreachable):notice:IPv6,tunneling loc net
|
|||||||
is 2 and AF_INET6 is 10).</para>
|
is 2 and AF_INET6 is 10).</para>
|
||||||
|
|
||||||
<para>The name immediately following the number is the currently-selected
|
<para>The name immediately following the number is the currently-selected
|
||||||
backend, and the ones in parentheses are the ones that are available. You
|
backend, and the ones in parantheses are the ones that are available. You
|
||||||
can change the currently selected backend by echoing it's name into
|
can change the currently selected backend by echoing it's name into
|
||||||
/proc/net/netfilter/nf_log.<replaceable>number</replaceable>.</para>
|
/proc/net/netfilter/nf_log.<replaceable>number</replaceable>.</para>
|
||||||
|
|
||||||
|
@@ -681,7 +681,7 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>Added in Shorewall 5.1.9. This target only applies to
|
<para>Added in Shorewall 5.1.9. This target only applies to
|
||||||
TCP traffic and alters the MSS value in SYN packets. It may be
|
TCP traffic and alters the MSS value in SYN packets. It may be
|
||||||
used in the FORWARD and POSTROUTING chains; the default is
|
used in the FOWARD and POSTROUTING chains; the default is
|
||||||
FORWARD.</para>
|
FORWARD.</para>
|
||||||
|
|
||||||
<para>The <replaceable>mss</replaceable> parameter may be
|
<para>The <replaceable>mss</replaceable> parameter may be
|
||||||
|
@@ -84,7 +84,7 @@
|
|||||||
|
|
||||||
<para>If PROVIDER_OFFSET is non-zero in <ulink
|
<para>If PROVIDER_OFFSET is non-zero in <ulink
|
||||||
url="/manpages/shorewall.conf.html">shorewall.conf(5)</ulink>, then
|
url="/manpages/shorewall.conf.html">shorewall.conf(5)</ulink>, then
|
||||||
the value must be a multiple of 2^^PROVIDER_OFFSET. In all cases, the
|
the value must be a mutiple of 2^^PROVIDER_OFFSET. In all cases, the
|
||||||
number of significant bits may not exceed PROVIDER_OFFSET +
|
number of significant bits may not exceed PROVIDER_OFFSET +
|
||||||
PROVIDER_BITS.</para>
|
PROVIDER_BITS.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
@@ -160,9 +160,7 @@
|
|||||||
how often the rate is estimated and how many samples are retained
|
how often the rate is estimated and how many samples are retained
|
||||||
for estimating. Please see <ulink
|
for estimating. Please see <ulink
|
||||||
url="http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt">http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt</ulink>
|
url="http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt">http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt</ulink>
|
||||||
for details. If not specified, the default
|
for details.</para>
|
||||||
<replaceable>interval</replaceable> is 250ms and the default
|
|
||||||
<replaceable>decay_interval</replaceable> is 4sec.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
@@ -172,9 +172,7 @@
|
|||||||
how often the rate is estimated and how many samples are retained
|
how often the rate is estimated and how many samples are retained
|
||||||
for estimating. Please see <ulink
|
for estimating. Please see <ulink
|
||||||
url="http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt">http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt</ulink>
|
url="http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt">http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt</ulink>
|
||||||
for details. If not specified, the default
|
for details.</para>
|
||||||
<replaceable>interval</replaceable> is 250ms and the default
|
|
||||||
<replaceable>decay_interval</replaceable> is 4sec.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
@@ -673,7 +673,7 @@
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis
|
<term><emphasis
|
||||||
role="bold">CONFIG_PATH</emphasis>=[[:]<emphasis>directory</emphasis>[:<emphasis>directory</emphasis>]...]</term>
|
role="bold">CONFIG_PATH</emphasis>=[<emphasis>directory</emphasis>[:<emphasis>directory</emphasis>]...]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Specifies where configuration files other than
|
<para>Specifies where configuration files other than
|
||||||
@@ -701,16 +701,6 @@
|
|||||||
/etc/shorewall:/usr/share/shorewall but your particular distribution
|
/etc/shorewall:/usr/share/shorewall but your particular distribution
|
||||||
may set it differently. See the output of shorewall show config for
|
may set it differently. See the output of shorewall show config for
|
||||||
the default on your system.</para>
|
the default on your system.</para>
|
||||||
|
|
||||||
<para>Beginning with Shorewall 5.1.10, the CONFIG_PATH setting may
|
|
||||||
begin with a colon (":"), to signal that the first
|
|
||||||
<replaceable>directory</replaceable> listed will be skipped if the
|
|
||||||
user performing a compilation is not root or if the configuration is
|
|
||||||
being compiled for export (-e option specified or if running one of
|
|
||||||
the remote-* commands) . This prevents the compiler from looking in
|
|
||||||
<filename>/etc/shorewall[6]</filename>/ when compilation is being
|
|
||||||
done by a non-root user or if the generated script is to be sent to
|
|
||||||
a remote firewall system.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -730,14 +720,6 @@
|
|||||||
and <command>restart</command> commands will succeed even if no DNS
|
and <command>restart</command> commands will succeed even if no DNS
|
||||||
server is reachable (assuming that the configuration hasn't changed
|
server is reachable (assuming that the configuration hasn't changed
|
||||||
since the compiled script was last generated).</para>
|
since the compiled script was last generated).</para>
|
||||||
|
|
||||||
<important>
|
|
||||||
<para>When DEFER_DNS_RESOLUTION=No and AUTOMAKE=Yes and a DNS
|
|
||||||
change makes it necessary to recompile an existing firewall
|
|
||||||
script, the <option>-c</option> option must be used with the
|
|
||||||
<command>reload</command> or <command>restart</command> command to
|
|
||||||
force recompilation.</para>
|
|
||||||
</important>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
@@ -11,5 +11,5 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#ZONE INTERFACE OPTIONS
|
#ZONE INTERFACE OPTIONS
|
||||||
- lo ignore
|
- lo ignore
|
||||||
net all dhcp,physical=+,routeback
|
net all dhcp,physical=+,routeback,sourceroute=0
|
||||||
|
|
||||||
|
@@ -74,7 +74,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
|
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall"
|
CONFIG_PATH=${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
|
@@ -75,7 +75,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
|
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall6:/usr/share/shorewall6:${SHAREDIR}/shorewall"
|
CONFIG_PATH="${CONFDIR}/shorewall6:/usr/share/shorewall6:${SHAREDIR}/shorewall"
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
|
@@ -74,7 +74,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
|
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall"
|
CONFIG_PATH=${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
|
@@ -74,7 +74,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
|
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall"
|
CONFIG_PATH=${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
|
@@ -8,43 +8,42 @@
|
|||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#ACTION
|
#ACTION
|
||||||
A_Drop # Audited Default Action for DROP policy
|
A_Drop # Audited Default Action for DROP policy
|
||||||
A_Reject # Audited Default Action for REJECT policy
|
A_Reject # Audited Default Action for REJECT policy
|
||||||
A_AllowICMPs proto=58 # Audited Accept needed ICMP6 types
|
A_AllowICMPs # Audited Accept needed ICMP6 types
|
||||||
AllowICMPs proto=58 # Accept needed ICMP6 types
|
AllowICMPs # Accept needed ICMP6 types
|
||||||
allowBcast inline # Silently Allow Broadcast
|
allowBcast inline # Silently Allow Broadcast
|
||||||
allowInvalid inline # Accepts packets in the INVALID conntrack state
|
allowInvalid inline # Accepts packets in the INVALID conntrack state
|
||||||
allowMcast inline # Silently Allow Multicast
|
allowMcast inline # Silently Allow Multicast
|
||||||
AutoBL noinline # Auto-blacklist IPs that exceed thesholds
|
AutoBL noinline # Auto-blacklist IPs that exceed thesholds
|
||||||
AutoBLL noinline # Helper for AutoBL
|
AutoBLL noinline # Helper for AutoBL
|
||||||
BLACKLIST logjump,section # Add sender to the dynamic blacklist
|
BLACKLIST logjump,section # Add sender to the dynamic blacklist
|
||||||
Broadcast noinline # Handles Broadcast/Anycast
|
Broadcast noinline # Handles Broadcast/Anycast
|
||||||
Drop # Default Action for DROP policy (deprecated)
|
Drop # Default Action for DROP policy (deprecated)
|
||||||
dropBcast inline # Silently Drop Broadcast
|
dropBcast inline # Silently Drop Broadcast
|
||||||
dropBcasts inline # Silently Drop Broadcast
|
dropBcasts inline # Silently Drop Broadcast
|
||||||
dropInvalid inline # Drops packets in the INVALID conntrack state
|
dropInvalid inline # Drops packets in the INVALID conntrack state
|
||||||
dropMcast inline # Silently Drop Multicast
|
dropMcast inline # Silently Drop Multicast
|
||||||
dropNotSyn noinline,proto=6 # Silently Drop Non-syn TCP packets
|
dropNotSyn noinline # Silently Drop Non-syn TCP packets
|
||||||
DropDNSrep inline,proto=17 # Drops DNS replies
|
DropDNSrep inline # Drops DNS replies
|
||||||
DropSmurfs noinline # Handles packets with a broadcast source address
|
DropSmurfs noinline # Handles packets with a broadcast source address
|
||||||
Established inline,\ # Handles packets in the ESTABLISHED state
|
Established inline,\ # Handles packets in the ESTABLISHED state
|
||||||
state=ESTABLISHED
|
state=ESTABLISHED
|
||||||
FIN inline,audit,\ # Handles ACK,FIN,PSH packets
|
FIN inline,audit # Handles ACK,FIN,PSH packets
|
||||||
proto=6
|
|
||||||
forwardUPnP noinline # Allow traffic that upnpd has redirected from 'upnp' interfaces.
|
forwardUPnP noinline # Allow traffic that upnpd has redirected from 'upnp' interfaces.
|
||||||
IfEvent noinline # Perform an action based on an event
|
IfEvent noinline # Perform an action based on an event
|
||||||
Invalid inline,audit,\ # Handles packets in the INVALID conntrack state
|
Invalid inline,audit,\ # Handles packets in the INVALID conntrack state
|
||||||
state=INVALID
|
state=INVALID
|
||||||
Multicast noinline # Handles Multicast
|
Multicast noinline # Handles Multicast
|
||||||
New inline,state=NEW # Handles packets in the NEW conntrack state
|
New inline,state=NEW # Handles packets in the NEW conntrack state
|
||||||
NotSyn inline,proto=6 # Handles TCP packets that do not have SYN=1 and ACK=0
|
NotSyn inline # Handles TCP packets that do not have SYN=1 and ACK=0
|
||||||
Reject # Default Action for REJECT policy (deprecated)
|
Reject # Default Action for REJECT policy (deprecated)
|
||||||
rejNotSyn noinline,proto=6 # Silently Reject Non-syn TCP packets
|
rejNotSyn noinline # Silently Reject Non-syn TCP packets
|
||||||
Related inline,\ # Handles packets in the RELATED conntrack state
|
Related inline,\ # Handles packets in the RELATED conntrack state
|
||||||
state=RELATED
|
state=RELATED
|
||||||
ResetEvent inline # Reset an Event
|
ResetEvent inline # Reset an Event
|
||||||
RST inline,proto=6 # Handle packets with RST set
|
RST inline # Handle packets with RST set
|
||||||
SetEvent inline # Initialize an event
|
SetEvent inline # Initialize an event
|
||||||
TCPFlags proto=6 # Handles bad flags combinations
|
TCPFlags # Handles bad flags combinations
|
||||||
Untracked inline,\ # Handles packets in the UNTRACKED conntrack state
|
Untracked inline,\ # Handles packets in the UNTRACKED conntrack state
|
||||||
state=UNTRACKED
|
state=UNTRACKED
|
||||||
|
@@ -74,7 +74,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
|
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall6:/usr/share/shorewall6:${SHAREDIR}/shorewall"
|
CONFIG_PATH="${CONFDIR}/shorewall6:/usr/share/shorewall6:${SHAREDIR}/shorewall"
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
|
@@ -3,4 +3,4 @@
|
|||||||
#
|
#
|
||||||
# /usr/share/shorewall6/configpath
|
# /usr/share/shorewall6/configpath
|
||||||
#
|
#
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall"
|
CONFIG_PATH=${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall
|
||||||
|
@@ -71,7 +71,7 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>PPTP (TCP 1723)</para>
|
<para>PPTP (TCP 1729)</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -121,10 +121,9 @@
|
|||||||
of your system.</para>
|
of your system.</para>
|
||||||
|
|
||||||
<para>Many of the modules allow parameters to be specified when the
|
<para>Many of the modules allow parameters to be specified when the
|
||||||
module is loaded. Among the common parameters is the
|
module is loaded. Among the common parameters is the ports parameter
|
||||||
<option>ports</option> parameter that lists one or more ports that the
|
that lists one or more ports that the module is to monitor. This allows
|
||||||
module is to monitor. This allows running the application on a
|
running the application on a non-standard port.</para>
|
||||||
non-standard port.</para>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
@@ -85,7 +85,7 @@
|
|||||||
url="manpages/shorewall-blrules.html">shorewall-blrules</ulink> (5)).
|
url="manpages/shorewall-blrules.html">shorewall-blrules</ulink> (5)).
|
||||||
There you have access to the DROP, ACCEPT, REJECT and WHITELIST actions,
|
There you have access to the DROP, ACCEPT, REJECT and WHITELIST actions,
|
||||||
standard and custom macros as well as standard and custom actions. See
|
standard and custom macros as well as standard and custom actions. See
|
||||||
<ulink url="manpages/shorewall-blrules.html">shorewall-blrules</ulink> (5)
|
<ulink url="manpages/shorewall-rules.html">shorewall-blrules</ulink> (5)
|
||||||
for details.</para>
|
for details.</para>
|
||||||
|
|
||||||
<para>Example:</para>
|
<para>Example:</para>
|
||||||
@@ -265,7 +265,7 @@ DROP net:200.55.14.18 all
|
|||||||
|
|
||||||
<para>Beginning with Shorewall 5.1.1, it is possible to specify BLACKLIST
|
<para>Beginning with Shorewall 5.1.1, it is possible to specify BLACKLIST
|
||||||
in the POLICY column of <ulink
|
in the POLICY column of <ulink
|
||||||
url="manpages/shorewall-policy.html">shorewall-policy</ulink>(5) when
|
url="manpages/shorewall-policies.html">shorewall-policies</ulink>(5) when
|
||||||
ipset-based dynamic blacklisting is being used. When a packet is disposed
|
ipset-based dynamic blacklisting is being used. When a packet is disposed
|
||||||
of via the BLACKLIST policy, the packet's sender is added to the dynamic
|
of via the BLACKLIST policy, the packet's sender is added to the dynamic
|
||||||
blacklist ipset and the packet is dropped.</para>
|
blacklist ipset and the packet is dropped.</para>
|
||||||
|
@@ -2498,63 +2498,27 @@ gmail-pop.l.google.com. <emphasis role="bold">300</emphasis> IN A 209.85.2
|
|||||||
<programlisting>#ACTION SOURCE DEST PROTO DPORT
|
<programlisting>#ACTION SOURCE DEST PROTO DPORT
|
||||||
POP(ACCEPT) loc net:pop.gmail.com</programlisting>
|
POP(ACCEPT) loc net:pop.gmail.com</programlisting>
|
||||||
|
|
||||||
<para>There are two options in <ulink
|
<para>If your firewall rules include DNS names then:</para>
|
||||||
url="manpages/shorewall.conf.html">shorewall[6].conf(5)</ulink> that
|
|
||||||
affect the use of DNS names in Shorewall[6] config files:</para>
|
|
||||||
|
|
||||||
<itemizedlist>
|
|
||||||
<listitem>
|
|
||||||
<para>DEFER_DNS_RESOLUTION - When set to No, DNS names are resolved at
|
|
||||||
compile time; when set to Yes, DNS Names are resolved at
|
|
||||||
runtime.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>AUTOMAKE - When set to Yes, <command>start</command>,
|
|
||||||
<command>restart</command> and <command>reload</command> only result
|
|
||||||
in compilation if one of the files on the CONFIG_PATH has changed
|
|
||||||
since the the last compilation.</para>
|
|
||||||
</listitem>
|
|
||||||
</itemizedlist>
|
|
||||||
|
|
||||||
<para>So by setting AUTOMAKE=Yes, and DEFER_DNS_RESOLUTION=No, compilation
|
|
||||||
will only take place at boot time if a change had been make to the config
|
|
||||||
but no <command>restart</command> or <command>reload</command> had taken
|
|
||||||
place. This is clearly spelled out in the shorewall.conf manpage. So with
|
|
||||||
these settings, so long as a 'reload' or 'restart' takes place after the
|
|
||||||
Shorewall configuration is changes, there should be no DNS-related
|
|
||||||
problems at boot time.</para>
|
|
||||||
|
|
||||||
<important>
|
|
||||||
<para>When DEFER_DNS_RESOLUTION=No and AUTOMAKE=Yes and a DNS change
|
|
||||||
makes it necessary to recompile an existing firewall script, the
|
|
||||||
<option>-c</option> option must be used with the
|
|
||||||
<command>reload</command> or <command>restart</command> command to force
|
|
||||||
recompilation.</para>
|
|
||||||
</important>
|
|
||||||
|
|
||||||
<para>If your firewall rules include DNS names then, even if
|
|
||||||
DEFER_DNS_RESOLUTION=No and AUTOMAKE=Yes:</para>
|
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>If your <filename>/etc/resolv.conf </filename>is wrong then your
|
<para>If your <filename>/etc/resolv.conf </filename>is wrong then your
|
||||||
firewall may not start.</para>
|
firewall won't start.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>If your <filename>/etc/nsswitch.conf</filename> is wrong then
|
<para>If your <filename>/etc/nsswitch.conf</filename> is wrong then
|
||||||
your firewall may not start.</para>
|
your firewall won't start.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>If your Name Server(s) is(are) down then your firewall may not
|
<para>If your Name Server(s) is(are) down then your firewall won't
|
||||||
start.</para>
|
start.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>If your startup scripts try to start your firewall before
|
<para>If your startup scripts try to start your firewall before
|
||||||
starting your DNS server then your firewall may not start.</para>
|
starting your DNS server then your firewall won't start.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -2564,7 +2528,7 @@ POP(ACCEPT) loc net:pop.gmail.com</programlisting>
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You must bring up your network interfaces prior to starting your
|
<para>You must bring up your network interfaces prior to starting your
|
||||||
firewall, or the firewall may not start.</para>
|
firewall.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
|
@@ -278,7 +278,7 @@
|
|||||||
time:</para>
|
time:</para>
|
||||||
|
|
||||||
<programlisting>gateway:/etc/shorewall# grep -v ^\# * | egrep '\$LOG|ULOG|LOGFILE'
|
<programlisting>gateway:/etc/shorewall# grep -v ^\# * | egrep '\$LOG|ULOG|LOGFILE'
|
||||||
params:LOG=NFLOG
|
params:LOG=NFOG
|
||||||
policy:loc $FW REJECT $LOG
|
policy:loc $FW REJECT $LOG
|
||||||
policy:net all DROP $LOG 10/sec:40
|
policy:net all DROP $LOG 10/sec:40
|
||||||
policy:all all REJECT $LOG
|
policy:all all REJECT $LOG
|
||||||
|
Reference in New Issue
Block a user