forked from extern/shorewall_code
Compare commits
31 Commits
5.1.6-RC1
...
5.1.7-base
Author | SHA1 | Date | |
---|---|---|---|
|
be5aabcbfb | ||
|
a8937e6bc8 | ||
|
e91bd9a0e9 | ||
|
5e1cf17ebc | ||
|
85a7ec6fe5 | ||
|
fb831e3128 | ||
|
2ed11c7e15 | ||
|
ef1353790e | ||
|
4f79d2e82b | ||
|
e6a2ba78a4 | ||
|
41ea3bdeda | ||
|
1065c2951b | ||
|
3b373f3f21 | ||
|
0c05ab3bff | ||
|
ef3a33e3f4 | ||
|
8a78fb6e77 | ||
|
b54a691110 | ||
|
90f33dd436 | ||
|
b7aef24d7c | ||
|
6f475cde3f | ||
|
6053a40af0 | ||
|
7e4dba7623 | ||
|
3d322d31b7 | ||
|
34e4fffd7d | ||
|
2e98d4375b | ||
|
419ff8903b | ||
|
390ac30be8 | ||
|
8cb98f16ea | ||
|
5a9f179e25 | ||
|
d8eca457de | ||
|
8641d53bd1 |
@@ -3727,7 +3727,7 @@ ipcalc_command() {
|
|||||||
|
|
||||||
valid_address $address || fatal_error "Invalid IP address: $address"
|
valid_address $address || fatal_error "Invalid IP address: $address"
|
||||||
[ -z "$vlsm" ] && fatal_error "Missing VLSM"
|
[ -z "$vlsm" ] && fatal_error "Missing VLSM"
|
||||||
[ "x$address" = "x$vlsm" ] && "Invalid VLSM"
|
[ "x$address" = "x$vlsm" ] && fatal_error "Invalid VLSM"
|
||||||
[ $vlsm -gt 32 ] && fatal_error "Invalid VLSM: /$vlsm"
|
[ $vlsm -gt 32 ] && fatal_error "Invalid VLSM: /$vlsm"
|
||||||
|
|
||||||
address=$address/$vlsm
|
address=$address/$vlsm
|
||||||
|
@@ -269,53 +269,48 @@ loadmodule() # $1 = module name, $2 - * arguments
|
|||||||
{
|
{
|
||||||
local modulename
|
local modulename
|
||||||
modulename=$1
|
modulename=$1
|
||||||
|
shift
|
||||||
|
local moduleoptions
|
||||||
|
moduleoptions=$*
|
||||||
local modulefile
|
local modulefile
|
||||||
local suffix
|
local suffix
|
||||||
|
|
||||||
if [ -d /sys/module/ ]; then
|
if [ -d /sys/module/ ]; then
|
||||||
if ! list_search $modulename $DONT_LOAD; then
|
if ! list_search $modulename $DONT_LOAD; then
|
||||||
if [ ! -d /sys/module/$modulename ]; then
|
if [ ! -d /sys/module/$modulename ]; then
|
||||||
shift
|
case $moduleloader in
|
||||||
|
insmod)
|
||||||
for suffix in $MODULE_SUFFIX ; do
|
for directory in $moduledirectories; do
|
||||||
for directory in $moduledirectories; do
|
for modulefile in $directory/${modulename}.*; do
|
||||||
modulefile=$directory/${modulename}.${suffix}
|
if [ -f $modulefile ]; then
|
||||||
|
insmod $modulefile $moduleoptions
|
||||||
if [ -f $modulefile ]; then
|
return
|
||||||
case $moduleloader in
|
fi
|
||||||
insmod)
|
done
|
||||||
insmod $modulefile $*
|
done
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
modprobe $modulename $*
|
modprobe -q $modulename $moduleoptions
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
break 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
elif ! list_search $modulename $DONT_LOAD $MODULES; then
|
elif ! list_search $modulename $DONT_LOAD $MODULES; then
|
||||||
shift
|
case $moduleloader in
|
||||||
|
insmod)
|
||||||
for suffix in $MODULE_SUFFIX ; do
|
for directory in $moduledirectories; do
|
||||||
for directory in $moduledirectories; do
|
for modulefile in $directory/${modulename}.*; do
|
||||||
modulefile=$directory/${modulename}.${suffix}
|
if [ -f $modulefile ]; then
|
||||||
|
insmod $modulefile $moduleoptions
|
||||||
if [ -f $modulefile ]; then
|
return
|
||||||
case $moduleloader in
|
fi
|
||||||
insmod)
|
done
|
||||||
insmod $modulefile $*
|
done
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
modprobe $modulename $*
|
modprobe -q $modulename $moduleoptions
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
break 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,8 +333,6 @@ reload_kernel_modules() {
|
|||||||
moduleloader=insmod
|
moduleloader=insmod
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "${MODULE_SUFFIX:=ko ko.gz ko.xz o o.gz o.xz gz xz}" ]
|
|
||||||
|
|
||||||
if [ -n "$MODULESDIR" ]; then
|
if [ -n "$MODULESDIR" ]; then
|
||||||
case "$MODULESDIR" in
|
case "$MODULESDIR" in
|
||||||
+*)
|
+*)
|
||||||
@@ -394,8 +387,6 @@ load_kernel_modules() # $1 = Yes, if we are to save moduleinfo in $VARDIR
|
|||||||
moduleloader=insmod
|
moduleloader=insmod
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "${MODULE_SUFFIX:=o gz xz ko o.gz o.xz ko.gz ko.xz}" ]
|
|
||||||
|
|
||||||
if [ -n "$MODULESDIR" ]; then
|
if [ -n "$MODULESDIR" ]; then
|
||||||
case "$MODULESDIR" in
|
case "$MODULESDIR" in
|
||||||
+*)
|
+*)
|
||||||
|
@@ -159,8 +159,9 @@ shorewall_stop () {
|
|||||||
|
|
||||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" || rm -f "${SAVE_IPSETS}.tmp"
|
||||||
else
|
else
|
||||||
|
rm -f "${SAVE_IPSETS}.tmp"
|
||||||
echo_notdone
|
echo_notdone
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -66,6 +66,10 @@ start () {
|
|||||||
|
|
||||||
printf "Initializing \"Shorewall-based firewalls\": "
|
printf "Initializing \"Shorewall-based firewalls\": "
|
||||||
|
|
||||||
|
if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then
|
||||||
|
ipset -R < "$SAVE_IPSETS"
|
||||||
|
fi
|
||||||
|
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
setstatedir
|
setstatedir
|
||||||
retval=$?
|
retval=$?
|
||||||
@@ -120,6 +124,15 @@ stop () {
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ $retval -eq 0 ]; then
|
if [ $retval -eq 0 ]; then
|
||||||
|
if [ -n "$SAVE_IPSETS" ]; then
|
||||||
|
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||||
|
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||||
|
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" || rm -f "${SAVE_IPSETS}.tmp"
|
||||||
|
else
|
||||||
|
rm -f "${SAVE_IPSETS}.tmp"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
rm -f $lockfile
|
rm -f $lockfile
|
||||||
success
|
success
|
||||||
else
|
else
|
||||||
|
@@ -126,7 +126,9 @@ stop () {
|
|||||||
if [ -n "$SAVE_IPSETS" ]; then
|
if [ -n "$SAVE_IPSETS" ]; then
|
||||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" || rm -f "${SAVE_IPSETS}.tmp"
|
||||||
|
else
|
||||||
|
rm -f "${SAVE_IPSETS}.tmp"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@@ -116,7 +116,9 @@ shorewall_stop () {
|
|||||||
if [ -n "$SAVE_IPSETS" ]; then
|
if [ -n "$SAVE_IPSETS" ]; then
|
||||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" || rm -f "${SAVE_IPSETS}.tmp"
|
||||||
|
else
|
||||||
|
rm -f "${SAVE_IPSETS}.tmp"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -126,7 +126,9 @@ shorewall_stop () {
|
|||||||
if [ -n "$SAVE_IPSETS" ]; then
|
if [ -n "$SAVE_IPSETS" ]; then
|
||||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" || rm -f "${SAVE_IPSETS}.tmp"
|
||||||
|
else
|
||||||
|
rm -f "${SAVE_IPSETS}.tmp"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@@ -104,7 +104,9 @@ shorewall_stop () {
|
|||||||
if [ -n "$SAVE_IPSETS" ]; then
|
if [ -n "$SAVE_IPSETS" ]; then
|
||||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" || rm -f "${SAVE_IPSETS}.tmp"
|
||||||
|
else
|
||||||
|
rm -f "${SAVE_IPSETS}.tmp"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#
|
#
|
||||||
# On the target system (the system where the firewall program is to run):
|
# On the target system (the system where the firewall program is to run):
|
||||||
#
|
#
|
||||||
# [ IPTABLES=<iptables binary> ] [ MODULESDIR=<kernel modules directory> ] [ MODULE_SUFFIX="<module suffix list>" ] shorecap > capabilities
|
# [ IPTABLES=<iptables binary> ] [ MODULESDIR=<kernel modules directory> ] shorecap > capabilities
|
||||||
#
|
#
|
||||||
# Now move the capabilities file to the compilation system. The file must
|
# Now move the capabilities file to the compilation system. The file must
|
||||||
# be placed in a directory on the CONFIG_PATH to be used when compiling firewalls
|
# be placed in a directory on the CONFIG_PATH to be used when compiling firewalls
|
||||||
@@ -38,7 +38,6 @@
|
|||||||
#
|
#
|
||||||
# IPTABLES - iptables
|
# IPTABLES - iptables
|
||||||
# MODULESDIR - /lib/modules/$(uname -r)/kernel/net/ipv4/netfilter
|
# MODULESDIR - /lib/modules/$(uname -r)/kernel/net/ipv4/netfilter
|
||||||
# MODULE_SUFFIX - "o gz xz ko o.gz o.xz ko.gz ko.xz"
|
|
||||||
#
|
#
|
||||||
# Shorewall need not be installed on the target system to run shorecap. If the '-e' flag is
|
# Shorewall need not be installed on the target system to run shorecap. If the '-e' flag is
|
||||||
# used during firewall compilation, then the generated firewall program will likewise not
|
# used during firewall compilation, then the generated firewall program will likewise not
|
||||||
|
@@ -107,6 +107,11 @@ if ( $command & $REAP_OPT ) {
|
|||||||
|
|
||||||
$duration .= '--rttl ' if $command & $TTL_OPT;
|
$duration .= '--rttl ' if $command & $TTL_OPT;
|
||||||
|
|
||||||
|
if ( ( $targets{$action} || 0 ) & NATRULE ) {
|
||||||
|
perl_action_helper( "${action}-", "-m recent --rcheck ${duration}--hitcount $hitcount" );
|
||||||
|
$action = 'ACCEPT';
|
||||||
|
}
|
||||||
|
|
||||||
if ( $command & $RESET_CMD ) {
|
if ( $command & $RESET_CMD ) {
|
||||||
require_capability 'MARK_ANYWHERE', '"reset"', 's';
|
require_capability 'MARK_ANYWHERE', '"reset"', 's';
|
||||||
|
|
||||||
|
@@ -41,6 +41,11 @@ fatal_error "Invalid Src or Dest ($destination)" unless $destination =~ /^(?:src
|
|||||||
set_action_disposition( $disposition) if supplied $disposition;
|
set_action_disposition( $disposition) if supplied $disposition;
|
||||||
set_action_name_to_caller;
|
set_action_name_to_caller;
|
||||||
|
|
||||||
|
if ( ( $targets{$action} || 0 ) & NATRULE ) {
|
||||||
|
perl_action_helper( "${action}-", "" );
|
||||||
|
$action = 'ACCEPT';
|
||||||
|
}
|
||||||
|
|
||||||
if ( $destination eq 'dst' ) {
|
if ( $destination eq 'dst' ) {
|
||||||
perl_action_helper( $action, '', '', "-m recent --name $event --remove --rdest" );
|
perl_action_helper( $action, '', '', "-m recent --name $event --remove --rdest" );
|
||||||
} else {
|
} else {
|
||||||
|
@@ -37,6 +37,11 @@ fatal_error "Invalid Src or Dest ($destination)" unless $destination =~ /^(?:src
|
|||||||
set_action_disposition( $disposition) if supplied $disposition;
|
set_action_disposition( $disposition) if supplied $disposition;
|
||||||
set_action_name_to_caller;
|
set_action_name_to_caller;
|
||||||
|
|
||||||
|
if ( ( $targets{$action} || 0 ) & NATRULE ) {
|
||||||
|
perl_action_helper( "${action}-", "" );
|
||||||
|
$action = 'ACCEPT';
|
||||||
|
}
|
||||||
|
|
||||||
if ( $destination eq 'dst' ) {
|
if ( $destination eq 'dst' ) {
|
||||||
perl_action_helper( $action, '', '', "-m recent --name $event --set --rdest" );
|
perl_action_helper( $action, '', '', "-m recent --name $event --set --rdest" );
|
||||||
} else {
|
} else {
|
||||||
|
@@ -6,4 +6,5 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
|
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
|
||||||
|
|
||||||
|
PARAM - - udp 3389
|
||||||
PARAM - - tcp 3389
|
PARAM - - tcp 3389
|
||||||
|
@@ -1345,8 +1345,6 @@ sub format_rule( $$;$ ) {
|
|||||||
} else {
|
} else {
|
||||||
$rule .= join( '' , ' --', $_, ' ', $value );
|
$rule .= join( '' , ' --', $_, ' ', $value );
|
||||||
}
|
}
|
||||||
|
|
||||||
next;
|
|
||||||
} elsif ( $type == EXPENSIVE ) {
|
} elsif ( $type == EXPENSIVE ) {
|
||||||
#
|
#
|
||||||
# Only emit expensive matches now if there are '-m nfacct' or '-m recent' matches in the rule
|
# Only emit expensive matches now if there are '-m nfacct' or '-m recent' matches in the rule
|
||||||
@@ -1929,7 +1927,7 @@ sub delete_reference( $$ ) {
|
|||||||
|
|
||||||
assert( $toref );
|
assert( $toref );
|
||||||
|
|
||||||
delete $toref->{references}{$fromref->{name}} unless --$toref->{references}{$fromref->{name}} > 0;
|
delete $toref->{references}{$fromref->{name}} if --$toref->{references}{$fromref->{name}} <= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -2067,7 +2065,7 @@ sub adjust_reference_counts( $$$ ) {
|
|||||||
my ($toref, $name1, $name2) = @_;
|
my ($toref, $name1, $name2) = @_;
|
||||||
|
|
||||||
if ( $toref ) {
|
if ( $toref ) {
|
||||||
delete $toref->{references}{$name1} unless --$toref->{references}{$name1} > 0;
|
delete $toref->{references}{$name1} if --$toref->{references}{$name1} <= 0;
|
||||||
$toref->{references}{$name2}++;
|
$toref->{references}{$name2}++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3275,8 +3273,10 @@ sub initialize_chain_table($) {
|
|||||||
$chainref = new_nat_chain( 'DOCKER' );
|
$chainref = new_nat_chain( 'DOCKER' );
|
||||||
set_optflags( $chainref, DONT_OPTIMIZE | DONT_DELETE | DONT_MOVE );
|
set_optflags( $chainref, DONT_OPTIMIZE | DONT_DELETE | DONT_MOVE );
|
||||||
add_commands( $chainref, '[ -f ${VARDIR}/.nat_DOCKER ] && cat ${VARDIR}/.nat_DOCKER >&3' );
|
add_commands( $chainref, '[ -f ${VARDIR}/.nat_DOCKER ] && cat ${VARDIR}/.nat_DOCKER >&3' );
|
||||||
|
$chainref = new_standard_chain( 'DOCKER-INGRESS' );
|
||||||
$chainref = new_standard_chain( 'DOCKER-ISOLATION' );
|
$chainref = new_standard_chain( 'DOCKER-ISOLATION' );
|
||||||
set_optflags( $chainref, DONT_OPTIMIZE | DONT_DELETE | DONT_MOVE );
|
set_optflags( $chainref, DONT_OPTIMIZE | DONT_DELETE | DONT_MOVE );
|
||||||
|
add_commands( $chainref, '[ -f ${VARDIR}/.filter_DOCKER-INGRESS ] && cat ${VARDIR}/.filter_DOCKER-INGRESS >&3' );
|
||||||
add_commands( $chainref, '[ -f ${VARDIR}/.filter_DOCKER-ISOLATION ] && cat ${VARDIR}/.filter_DOCKER-ISOLATION >&3' );
|
add_commands( $chainref, '[ -f ${VARDIR}/.filter_DOCKER-ISOLATION ] && cat ${VARDIR}/.filter_DOCKER-ISOLATION >&3' );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3900,7 +3900,10 @@ sub optimize_level8( $$$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$combined{ $chainref1->{name} } = $chainref->{name};
|
$combined{ $chainref1->{name} } = $chainref->{name};
|
||||||
|
#
|
||||||
|
# While rare, it is possible for a policy chain to be combined with a non-policy chain. So we need to preserve
|
||||||
|
# the policy attributes in the combined chain
|
||||||
|
#
|
||||||
if ( $chainref->{policychain} ) {
|
if ( $chainref->{policychain} ) {
|
||||||
@{$chainref1}{qw(policychain policy)} = @{$chainref}{qw(policychain policy)} unless $chainref1->{policychain};
|
@{$chainref1}{qw(policychain policy)} = @{$chainref}{qw(policychain policy)} unless $chainref1->{policychain};
|
||||||
} elsif ( $chainref1->{policychain} ) {
|
} elsif ( $chainref1->{policychain} ) {
|
||||||
@@ -4832,7 +4835,7 @@ sub do_proto( $$$;$ )
|
|||||||
$multiport = 1;
|
$multiport = 1;
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Missing DEST PORT" unless supplied $ports;
|
fatal_error "Missing DEST PORT" unless supplied $ports;
|
||||||
$ports = validate_portpair $pname , $ports;
|
$ports = validate_portpair $pname , $ports unless $ports =~ /^\$/;
|
||||||
$output .= ( $srcndst ? "-m multiport ${invert}--ports ${ports} " : "${invert}--dport ${ports} " );
|
$output .= ( $srcndst ? "-m multiport ${invert}--ports ${ports} " : "${invert}--dport ${ports} " );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5039,7 +5042,7 @@ sub do_iproto( $$$ )
|
|||||||
$multiport = 1;
|
$multiport = 1;
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Missing DEST PORT" unless supplied $ports;
|
fatal_error "Missing DEST PORT" unless supplied $ports;
|
||||||
$ports = validate_portpair $pname , $ports;
|
$ports = validate_portpair $pname , $ports unless $ports =~ /^\$/;
|
||||||
|
|
||||||
if ( $srcndst ) {
|
if ( $srcndst ) {
|
||||||
push @output, multiport => "${invert}--ports ${ports}";
|
push @output, multiport => "${invert}--ports ${ports}";
|
||||||
@@ -7064,6 +7067,8 @@ sub interface_gateway( $ ) {
|
|||||||
sub get_interface_gateway ( $;$$ ) {
|
sub get_interface_gateway ( $;$$ ) {
|
||||||
my ( $logical, $protect, $provider ) = @_;
|
my ( $logical, $protect, $provider ) = @_;
|
||||||
|
|
||||||
|
$provider = '' unless defined $provider;
|
||||||
|
|
||||||
my $interface = get_physical $logical;
|
my $interface = get_physical $logical;
|
||||||
my $variable = interface_gateway( $interface );
|
my $variable = interface_gateway( $interface );
|
||||||
my $gateway = get_interface_option( $interface, 'gateway' );
|
my $gateway = get_interface_option( $interface, 'gateway' );
|
||||||
@@ -7077,9 +7082,9 @@ sub get_interface_gateway ( $;$$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( interface_is_optional $logical ) {
|
if ( interface_is_optional $logical ) {
|
||||||
$interfacegateways{$interface} = qq([ -n "\$$variable" ] || $variable=\$(detect_gateway $interface));
|
$interfacegateways{$interface} = qq([ -n "\$$variable" ] || $variable=\$(detect_gateway $interface $provider));
|
||||||
} else {
|
} else {
|
||||||
$interfacegateways{$interface} = qq([ -n "\$$variable" ] || $variable=\$(detect_gateway $interface)
|
$interfacegateways{$interface} = qq([ -n "\$$variable" ] || $variable=\$(detect_gateway $interface $provider)
|
||||||
[ -n "\$$variable" ] || startup_error "Unable to detect the gateway through interface $interface");
|
[ -n "\$$variable" ] || startup_error "Unable to detect the gateway through interface $interface");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8456,6 +8461,7 @@ sub save_docker_rules($) {
|
|||||||
qq( $tool -t nat -S OUTPUT | tail -n +2 | fgrep DOCKER > \${VARDIR}/.nat_OUTPUT),
|
qq( $tool -t nat -S OUTPUT | tail -n +2 | fgrep DOCKER > \${VARDIR}/.nat_OUTPUT),
|
||||||
qq( $tool -t nat -S POSTROUTING | tail -n +2 | fgrep -v SHOREWALL > \${VARDIR}/.nat_POSTROUTING),
|
qq( $tool -t nat -S POSTROUTING | tail -n +2 | fgrep -v SHOREWALL > \${VARDIR}/.nat_POSTROUTING),
|
||||||
qq( $tool -t filter -S DOCKER | tail -n +2 > \${VARDIR}/.filter_DOCKER),
|
qq( $tool -t filter -S DOCKER | tail -n +2 > \${VARDIR}/.filter_DOCKER),
|
||||||
|
qq( [ -n "\$g_dockeringress" ] && $tool -t filter -S DOCKER-INGRESS | tail -n +2 > \${VARDIR}/.filter_DOCKER-INGRESS),
|
||||||
qq( [ -n "\$g_dockernetwork" ] && $tool -t filter -S DOCKER-ISOLATION | tail -n +2 > \${VARDIR}/.filter_DOCKER-ISOLATION)
|
qq( [ -n "\$g_dockernetwork" ] && $tool -t filter -S DOCKER-ISOLATION | tail -n +2 > \${VARDIR}/.filter_DOCKER-ISOLATION)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -8471,6 +8477,7 @@ sub save_docker_rules($) {
|
|||||||
q( rm -f ${VARDIR}/.nat_OUTPUT),
|
q( rm -f ${VARDIR}/.nat_OUTPUT),
|
||||||
q( rm -f ${VARDIR}/.nat_POSTROUTING),
|
q( rm -f ${VARDIR}/.nat_POSTROUTING),
|
||||||
q( rm -f ${VARDIR}/.filter_DOCKER),
|
q( rm -f ${VARDIR}/.filter_DOCKER),
|
||||||
|
q( rm -f ${VARDIR}/.filter_DOCKER-INGRESS),
|
||||||
q( rm -f ${VARDIR}/.filter_DOCKER-ISOLATION),
|
q( rm -f ${VARDIR}/.filter_DOCKER-ISOLATION),
|
||||||
q( rm -f ${VARDIR}/.filter_FORWARD),
|
q( rm -f ${VARDIR}/.filter_FORWARD),
|
||||||
q(fi)
|
q(fi)
|
||||||
@@ -8916,7 +8923,7 @@ sub create_netfilter_load( $ ) {
|
|||||||
'if [ "$COMMAND" = reload -a -n "$g_counters" ] && chain_exists $g_sha1sum1 && chain_exists $g_sha1sum2 ; then' );
|
'if [ "$COMMAND" = reload -a -n "$g_counters" ] && chain_exists $g_sha1sum1 && chain_exists $g_sha1sum2 ; then' );
|
||||||
|
|
||||||
if ( have_capability( 'RESTORE_WAIT_OPTION' ) ) {
|
if ( have_capability( 'RESTORE_WAIT_OPTION' ) ) {
|
||||||
emit( ' option="--counters --wait"' );
|
emit( ' option="--counters --wait "' . $config{MUTEX_TIMEOUT} );
|
||||||
} else {
|
} else {
|
||||||
emit( ' option="--counters"' );
|
emit( ' option="--counters"' );
|
||||||
}
|
}
|
||||||
@@ -8930,7 +8937,7 @@ sub create_netfilter_load( $ ) {
|
|||||||
push_indent;
|
push_indent;
|
||||||
|
|
||||||
if ( have_capability( 'RESTORE_WAIT_OPTION' ) ) {
|
if ( have_capability( 'RESTORE_WAIT_OPTION' ) ) {
|
||||||
emit 'option="--wait"';
|
emit 'option="--wait "' . $config{MUTEX_TIMEOUT};
|
||||||
} else {
|
} else {
|
||||||
emit 'option=';
|
emit 'option=';
|
||||||
}
|
}
|
||||||
@@ -8982,6 +8989,10 @@ sub create_netfilter_load( $ ) {
|
|||||||
enter_cmd_mode;
|
enter_cmd_mode;
|
||||||
emit( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
emit( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
||||||
enter_cat_mode;
|
enter_cat_mode;
|
||||||
|
} elsif ( $name eq 'DOCKER-INGRESS' ) {
|
||||||
|
enter_cmd_mode;
|
||||||
|
emit( '[ -n "$g_dockeringress" ] && echo ":DOCKER-INGRESS - [0:0]" >&3' );
|
||||||
|
enter_cat_mode;
|
||||||
} else {
|
} else {
|
||||||
emit_unindented ":$name - [0:0]";
|
emit_unindented ":$name - [0:0]";
|
||||||
}
|
}
|
||||||
@@ -9086,6 +9097,11 @@ sub preview_netfilter_load() {
|
|||||||
print( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
print( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
||||||
print "\n";
|
print "\n";
|
||||||
enter_cat_mode1;
|
enter_cat_mode1;
|
||||||
|
} elsif ( $name eq 'DOCKER-INGRESS' ) {
|
||||||
|
enter_cmd_mode1 unless $mode == CMD_MODE;
|
||||||
|
print( '[ -n "$g_dockeringress" ] && echo ":DOCKER-INGRESS - [0:0]" >&3' );
|
||||||
|
print "\n";
|
||||||
|
enter_cat_mode1;
|
||||||
} else {
|
} else {
|
||||||
enter_cmd_mode1 unless $mode == CMD_MODE;
|
enter_cmd_mode1 unless $mode == CMD_MODE;
|
||||||
print( ":$name - [0:0]\n" );
|
print( ":$name - [0:0]\n" );
|
||||||
@@ -9323,6 +9339,10 @@ sub create_stop_load( $ ) {
|
|||||||
enter_cmd_mode;
|
enter_cmd_mode;
|
||||||
emit( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
emit( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
||||||
enter_cat_mode;
|
enter_cat_mode;
|
||||||
|
} elsif ( $name eq 'DOCKER-INGRESS' ) {
|
||||||
|
enter_cmd_mode;
|
||||||
|
emit( '[ -n "$g_dockeringress" ] && echo ":DOCKER-INGRESS - [0:0]" >&3' );
|
||||||
|
enter_cat_mode;
|
||||||
} else {
|
} else {
|
||||||
emit_unindented ":$name - [0:0]";
|
emit_unindented ":$name - [0:0]";
|
||||||
}
|
}
|
||||||
@@ -9349,7 +9369,7 @@ sub create_stop_load( $ ) {
|
|||||||
enter_cmd_mode;
|
enter_cmd_mode;
|
||||||
|
|
||||||
if ( have_capability( 'RESTORE_WAIT_OPTION' ) ) {
|
if ( have_capability( 'RESTORE_WAIT_OPTION' ) ) {
|
||||||
emit( '[ -n "$g_debug_iptables" ] && command=debug_restore_input || command=$' . $UTILITY . ' --wait' );
|
emit( '[ -n "$g_debug_iptables" ] && command=debug_restore_input || command="$' . $UTILITY . ' --wait ' . $config{MUTEX_TIMEOUT} . '"' );
|
||||||
} else {
|
} else {
|
||||||
emit( '[ -n "$g_debug_iptables" ] && command=debug_restore_input || command=$' . $UTILITY );
|
emit( '[ -n "$g_debug_iptables" ] && command=debug_restore_input || command=$' . $UTILITY );
|
||||||
}
|
}
|
||||||
|
@@ -268,7 +268,8 @@ sub generate_script_2() {
|
|||||||
emit( '',
|
emit( '',
|
||||||
'chain_exists DOCKER nat && chain_exists DOCKER && g_docker=Yes',
|
'chain_exists DOCKER nat && chain_exists DOCKER && g_docker=Yes',
|
||||||
);
|
);
|
||||||
emit( 'chain_exists DOCKER-ISOLATION && g_dockernetwork=Yes]' );
|
emit( 'chain_exists DOCKER-INGRESS && g_dockeringress=Yes' );
|
||||||
|
emit( 'chain_exists DOCKER-ISOLATION && g_dockernetwork=Yes' );
|
||||||
emit( '' );
|
emit( '' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,6 +36,7 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
use File::Temp qw/ tempfile tempdir /;
|
use File::Temp qw/ tempfile tempdir /;
|
||||||
|
use File::Glob ':globally';
|
||||||
use Cwd qw(abs_path getcwd);
|
use Cwd qw(abs_path getcwd);
|
||||||
use autouse 'Carp' => qw(longmess confess);
|
use autouse 'Carp' => qw(longmess confess);
|
||||||
use Scalar::Util 'reftype';
|
use Scalar::Util 'reftype';
|
||||||
@@ -315,7 +316,7 @@ our %renamed = ( AUTO_COMMENT => 'AUTOCOMMENT', BLACKLIST_LOGLEVEL => 'BLACKLIST
|
|||||||
#
|
#
|
||||||
# Config options and global settings that are to be copied to output script
|
# Config options and global settings that are to be copied to output script
|
||||||
#
|
#
|
||||||
our @propagateconfig = qw/ DISABLE_IPV6 MODULESDIR MODULE_SUFFIX LOAD_HELPERS_ONLY LOCKFILE SUBSYSLOCK LOG_VERBOSITY RESTART/;
|
our @propagateconfig = qw/ DISABLE_IPV6 MODULESDIR LOAD_HELPERS_ONLY LOCKFILE SUBSYSLOCK LOG_VERBOSITY RESTART/;
|
||||||
#
|
#
|
||||||
# From parsing the capabilities file or detecting capabilities
|
# From parsing the capabilities file or detecting capabilities
|
||||||
#
|
#
|
||||||
@@ -648,6 +649,7 @@ our %eliminated = ( LOGRATE => 1,
|
|||||||
HIGH_ROUTE_MARKS => 1,
|
HIGH_ROUTE_MARKS => 1,
|
||||||
BLACKLISTNEWONLY => 1,
|
BLACKLISTNEWONLY => 1,
|
||||||
CHAIN_SCRIPTS => 1,
|
CHAIN_SCRIPTS => 1,
|
||||||
|
MODULE_SUFFIX => 1,
|
||||||
);
|
);
|
||||||
#
|
#
|
||||||
# Variables involved in ?IF, ?ELSE ?ENDIF processing
|
# Variables involved in ?IF, ?ELSE ?ENDIF processing
|
||||||
@@ -848,7 +850,6 @@ sub initialize( $;$$) {
|
|||||||
BLACKLIST => undef,
|
BLACKLIST => undef,
|
||||||
BLACKLISTNEWONLY => undef,
|
BLACKLISTNEWONLY => undef,
|
||||||
DELAYBLACKLISTLOAD => undef,
|
DELAYBLACKLISTLOAD => undef,
|
||||||
MODULE_SUFFIX => undef,
|
|
||||||
DISABLE_IPV6 => undef,
|
DISABLE_IPV6 => undef,
|
||||||
DYNAMIC_ZONES => undef,
|
DYNAMIC_ZONES => undef,
|
||||||
PKTTYPE=> undef,
|
PKTTYPE=> undef,
|
||||||
@@ -4287,7 +4288,7 @@ sub which( $ ) {
|
|||||||
# Load the kernel modules defined in the 'modules' file.
|
# Load the kernel modules defined in the 'modules' file.
|
||||||
#
|
#
|
||||||
sub load_kernel_modules( ) {
|
sub load_kernel_modules( ) {
|
||||||
my $moduleloader = which( 'modprobe' ) || ( which 'insmod' );
|
my $moduleloader = which( 'modprobe' ) || which( 'insmod' );
|
||||||
|
|
||||||
my $modulesdir = $config{MODULESDIR};
|
my $modulesdir = $config{MODULESDIR};
|
||||||
|
|
||||||
@@ -4320,25 +4321,20 @@ sub load_kernel_modules( ) {
|
|||||||
|
|
||||||
close LSMOD;
|
close LSMOD;
|
||||||
|
|
||||||
$config{MODULE_SUFFIX} = 'o gz xz ko o.gz o.xz ko.gz ko.xz' unless $config{MODULE_SUFFIX};
|
MODULE:
|
||||||
|
|
||||||
my @suffixes = split /\s+/ , $config{MODULE_SUFFIX};
|
|
||||||
|
|
||||||
while ( read_a_line( NORMAL_READ ) ) {
|
while ( read_a_line( NORMAL_READ ) ) {
|
||||||
fatal_error "Invalid modules file entry" unless ( $currentline =~ /^loadmodule\s+([a-zA-Z]\w*)\s*(.*)$/ );
|
fatal_error "Invalid modules file entry" unless ( $currentline =~ /^loadmodule\s+([a-zA-Z]\w*)\s*(.*)$/ );
|
||||||
my ( $module, $arguments ) = ( $1, $2 );
|
my ( $module, $arguments ) = ( $1, $2 );
|
||||||
unless ( $loadedmodules{ $module } ) {
|
unless ( $loadedmodules{ $module } ) {
|
||||||
for my $directory ( @moduledirectories ) {
|
if ( $moduleloader =~ /modprobe$/ ) {
|
||||||
for my $suffix ( @suffixes ) {
|
system( "modprobe -q $module $arguments" );
|
||||||
my $modulefile = "$directory/$module.$suffix";
|
$loadedmodules{ $module } = 1;
|
||||||
if ( -f $modulefile ) {
|
} else {
|
||||||
if ( $moduleloader eq 'insmod' ) {
|
for my $directory ( @moduledirectories ) {
|
||||||
system ("insmod $modulefile $arguments" );
|
for my $modulefile ( <$directory/$module.*> ) {
|
||||||
} else {
|
system ("insmod $modulefile $arguments" );
|
||||||
system( "modprobe $module $arguments" );
|
|
||||||
}
|
|
||||||
|
|
||||||
$loadedmodules{ $module } = 1;
|
$loadedmodules{ $module } = 1;
|
||||||
|
next MODULE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6070,7 +6066,6 @@ sub get_configuration( $$$$ ) {
|
|||||||
#
|
#
|
||||||
# get_capabilities requires that the true settings of these options be established
|
# get_capabilities requires that the true settings of these options be established
|
||||||
#
|
#
|
||||||
default 'MODULE_PREFIX', 'ko ko.gz o o.gz gz';
|
|
||||||
default_yes_no 'LOAD_HELPERS_ONLY' , 'Yes';
|
default_yes_no 'LOAD_HELPERS_ONLY' , 'Yes';
|
||||||
|
|
||||||
if ( ! $export && $> == 0 ) {
|
if ( ! $export && $> == 0 ) {
|
||||||
@@ -6256,7 +6251,7 @@ sub get_configuration( $$$$ ) {
|
|||||||
$config{LOG_VERBOSITY} = -1;
|
$config{LOG_VERBOSITY} = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
default_yes_no 'ADD_IP_ALIASES' , 'Yes';
|
default_yes_no 'ADD_IP_ALIASES' , $family == F_IPV4 ? 'Yes' : '';
|
||||||
default_yes_no 'ADD_SNAT_ALIASES' , '';
|
default_yes_no 'ADD_SNAT_ALIASES' , '';
|
||||||
default_yes_no 'DETECT_DNAT_IPADDRS' , '';
|
default_yes_no 'DETECT_DNAT_IPADDRS' , '';
|
||||||
default_yes_no 'DETECT_DNAT_IPADDRS' , '';
|
default_yes_no 'DETECT_DNAT_IPADDRS' , '';
|
||||||
@@ -6842,6 +6837,12 @@ sub get_configuration( $$$$ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( supplied( $val = $config{MUTEX_TIMEOUT} ) ) {
|
||||||
|
fatal_error "Invalid value ($val) for MUTEX_TIMEOUT" unless $val && $val =~ /^\d+$/;
|
||||||
|
} else {
|
||||||
|
$config{MUTEX_TIMEOUT} = 60;
|
||||||
|
}
|
||||||
|
|
||||||
add_variables %config;
|
add_variables %config;
|
||||||
|
|
||||||
while ( my ($var, $val ) = each %renamed ) {
|
while ( my ($var, $val ) = each %renamed ) {
|
||||||
|
@@ -667,6 +667,7 @@ sub create_docker_rules() {
|
|||||||
|
|
||||||
my $chainref = $filter_table->{FORWARD};
|
my $chainref = $filter_table->{FORWARD};
|
||||||
|
|
||||||
|
add_commands( $chainref, '[ -n "$g_dockeringress" ] && echo "-A FORWARD -j DOCKER-INGRESS" >&3', );
|
||||||
add_commands( $chainref, '[ -n "$g_dockernetwork" ] && echo "-A FORWARD -j DOCKER-ISOLATION" >&3', );
|
add_commands( $chainref, '[ -n "$g_dockernetwork" ] && echo "-A FORWARD -j DOCKER-ISOLATION" >&3', );
|
||||||
|
|
||||||
if ( my $dockerref = known_interface('docker0') ) {
|
if ( my $dockerref = known_interface('docker0') ) {
|
||||||
|
@@ -502,7 +502,7 @@ sub process_a_provider( $ ) {
|
|||||||
|
|
||||||
if ( ( $gw = lc $gateway ) eq 'detect' ) {
|
if ( ( $gw = lc $gateway ) eq 'detect' ) {
|
||||||
fatal_error "Configuring multiple providers through one interface requires an explicit gateway" if $shared;
|
fatal_error "Configuring multiple providers through one interface requires an explicit gateway" if $shared;
|
||||||
$gateway = get_interface_gateway( $interface, undef, 1 );
|
$gateway = get_interface_gateway( $interface, undef, $number );
|
||||||
$gatewaycase = 'detect';
|
$gatewaycase = 'detect';
|
||||||
set_interface_option( $interface, 'gateway', 'detect' );
|
set_interface_option( $interface, 'gateway', 'detect' );
|
||||||
} elsif ( $gw eq 'none' ) {
|
} elsif ( $gw eq 'none' ) {
|
||||||
|
@@ -216,6 +216,10 @@ our %statetable;
|
|||||||
# Tracks which of the state match actions (action.Invalid, etc.) that is currently being expanded
|
# Tracks which of the state match actions (action.Invalid, etc.) that is currently being expanded
|
||||||
#
|
#
|
||||||
our $statematch;
|
our $statematch;
|
||||||
|
#
|
||||||
|
# Remembers NAT-oriented columns from top-level action invocations
|
||||||
|
#
|
||||||
|
our %nat_columns;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Action/Inline options
|
# Action/Inline options
|
||||||
@@ -384,6 +388,8 @@ sub initialize( $ ) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%nat_columns = ( dest => '-', proto => '-', ports => '-' );
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
# Initialize variables moved from the Tc module in Shorewall 5.0.7 #
|
# Initialize variables moved from the Tc module in Shorewall 5.0.7 #
|
||||||
############################################################################
|
############################################################################
|
||||||
@@ -391,7 +397,7 @@ sub initialize( $ ) {
|
|||||||
%tcdevices = ();
|
%tcdevices = ();
|
||||||
%tcclasses = ();
|
%tcclasses = ();
|
||||||
$sticky = 0;
|
$sticky = 0;
|
||||||
$divertref = 0;
|
$divertref = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -1652,6 +1658,19 @@ sub merge_inline_source_dest( $$ ) {
|
|||||||
$body || '';
|
$body || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# This one is used by perl_action_helper()
|
||||||
|
#
|
||||||
|
sub merge_action_column( $$ ) {
|
||||||
|
my ( $body, $invocation ) = @_;
|
||||||
|
|
||||||
|
if ( supplied( $body ) && $body ne '-' ) {
|
||||||
|
$body;
|
||||||
|
} else {
|
||||||
|
$invocation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub merge_macro_column( $$ ) {
|
sub merge_macro_column( $$ ) {
|
||||||
my ( $body, $invocation ) = @_;
|
my ( $body, $invocation ) = @_;
|
||||||
|
|
||||||
@@ -2510,6 +2529,8 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
my $exceptionrule = '';
|
my $exceptionrule = '';
|
||||||
my $usergenerated;
|
my $usergenerated;
|
||||||
my $prerule = '';
|
my $prerule = '';
|
||||||
|
my %save_nat_columns = %nat_columns;
|
||||||
|
my $generated = 0;
|
||||||
#
|
#
|
||||||
# Subroutine for handling MARK and CONNMARK.
|
# Subroutine for handling MARK and CONNMARK.
|
||||||
#
|
#
|
||||||
@@ -2591,32 +2612,30 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
|
|
||||||
$current_param = $param unless $param eq '' || $param eq 'PARAM';
|
$current_param = $param unless $param eq '' || $param eq 'PARAM';
|
||||||
|
|
||||||
my $generated = process_macro( $basictarget,
|
$generated = process_macro( $basictarget,
|
||||||
$chainref,
|
$chainref,
|
||||||
$rule . $raw_matches,
|
$rule . $raw_matches,
|
||||||
$matches1,
|
$matches1,
|
||||||
$target,
|
$target,
|
||||||
$current_param,
|
$current_param,
|
||||||
$source,
|
$source,
|
||||||
$dest,
|
$dest,
|
||||||
$proto,
|
$proto,
|
||||||
$ports,
|
$ports,
|
||||||
$sports,
|
$sports,
|
||||||
$origdest,
|
$origdest,
|
||||||
$ratelimit,
|
$ratelimit,
|
||||||
$user,
|
$user,
|
||||||
$mark,
|
$mark,
|
||||||
$connlimit,
|
$connlimit,
|
||||||
$time,
|
$time,
|
||||||
$headers,
|
$headers,
|
||||||
$condition,
|
$condition,
|
||||||
$helper,
|
$helper,
|
||||||
$wildcard );
|
$wildcard );
|
||||||
|
|
||||||
$macro_nest_level--;
|
$macro_nest_level--;
|
||||||
|
goto EXIT;
|
||||||
return $generated;
|
|
||||||
|
|
||||||
} elsif ( $actiontype & NFQ ) {
|
} elsif ( $actiontype & NFQ ) {
|
||||||
$action = handle_nfqueue( $param,
|
$action = handle_nfqueue( $param,
|
||||||
1 # Allow 'bypass'
|
1 # Allow 'bypass'
|
||||||
@@ -2688,6 +2707,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
|
|
||||||
REDIRECT => sub () {
|
REDIRECT => sub () {
|
||||||
my $z = $actiontype & NATONLY ? '' : firewall_zone;
|
my $z = $actiontype & NATONLY ? '' : firewall_zone;
|
||||||
|
|
||||||
if ( $dest eq '-' ) {
|
if ( $dest eq '-' ) {
|
||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
$dest = ( $inchain ) ? '' : join( '', $z, '::' , $ports =~ /[:,]/ ? '' : $ports );
|
$dest = ( $inchain ) ? '' : join( '', $z, '::' , $ports =~ /[:,]/ ? '' : $ports );
|
||||||
@@ -2816,6 +2836,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Isolate and validate source and destination zones
|
# Isolate and validate source and destination zones
|
||||||
#
|
#
|
||||||
@@ -2909,7 +2930,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
#
|
#
|
||||||
if ( $destref->{type} & BPORT ) {
|
if ( $destref->{type} & BPORT ) {
|
||||||
unless ( $sourceref->{bridge} eq $destref->{bridge} || single_interface( $sourcezone ) eq $destref->{bridge} ) {
|
unless ( $sourceref->{bridge} eq $destref->{bridge} || single_interface( $sourcezone ) eq $destref->{bridge} ) {
|
||||||
return 0 if $wildcard;
|
goto EXIT if $wildcard;
|
||||||
fatal_error "Rules with a DESTINATION Bridge Port zone must have a SOURCE zone on the same bridge";
|
fatal_error "Rules with a DESTINATION Bridge Port zone must have a SOURCE zone on the same bridge";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2924,7 +2945,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
my $policy = $chainref->{policy};
|
my $policy = $chainref->{policy};
|
||||||
|
|
||||||
if ( $policy eq 'NONE' ) {
|
if ( $policy eq 'NONE' ) {
|
||||||
return 0 if $wildcard;
|
goto EXIT if $wildcard;
|
||||||
fatal_error "Rules may not override a NONE policy";
|
fatal_error "Rules may not override a NONE policy";
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
@@ -2933,9 +2954,9 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
if ( $optimize == 1 && $section == NEW_SECTION ) {
|
if ( $optimize == 1 && $section == NEW_SECTION ) {
|
||||||
my $loglevel = $filter_table->{$chainref->{policychain}}{loglevel};
|
my $loglevel = $filter_table->{$chainref->{policychain}}{loglevel};
|
||||||
if ( $loglevel ne '' ) {
|
if ( $loglevel ne '' ) {
|
||||||
return 0 if $target eq "${policy}:${loglevel}";
|
goto EXIT if $target eq "${policy}:${loglevel}";
|
||||||
} else {
|
} else {
|
||||||
return 0 if $basictarget eq $policy;
|
goto EXIT if $basictarget eq $policy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
@@ -2980,6 +3001,21 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
my $actionchain; # Name of the action chain
|
my $actionchain; # Name of the action chain
|
||||||
|
|
||||||
if ( $actiontype & ACTION ) {
|
if ( $actiontype & ACTION ) {
|
||||||
|
#
|
||||||
|
# Save NAT-oriented column contents
|
||||||
|
#
|
||||||
|
@nat_columns{'dest', 'proto', 'ports' } = ( $dest,
|
||||||
|
$proto eq '-' ? $nat_columns{proto} : $proto,
|
||||||
|
$ports eq '-' ? $nat_columns{ports} : $ports );
|
||||||
|
#
|
||||||
|
# Push the current column array onto the column stack
|
||||||
|
#
|
||||||
|
my @savecolumns = @columns;
|
||||||
|
#
|
||||||
|
# And store the (modified) columns into the columns array for use by perl_action[_tcp]_helper. We
|
||||||
|
# only need the NAT-oriented columns
|
||||||
|
#
|
||||||
|
@columns = ( undef , undef, $dest, $proto, $ports);
|
||||||
#
|
#
|
||||||
# Handle 'section' option
|
# Handle 'section' option
|
||||||
#
|
#
|
||||||
@@ -3023,6 +3059,8 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$action = $basictarget; # Remove params, if any, from $action.
|
$action = $basictarget; # Remove params, if any, from $action.
|
||||||
|
|
||||||
|
@columns = @savecolumns;
|
||||||
} elsif ( $actiontype & INLINE ) {
|
} elsif ( $actiontype & INLINE ) {
|
||||||
#
|
#
|
||||||
# process_inline() will call process_rule() recursively for each rule in the action body
|
# process_inline() will call process_rule() recursively for each rule in the action body
|
||||||
@@ -3039,34 +3077,34 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
|
|
||||||
$actionresult = 0;
|
$actionresult = 0;
|
||||||
|
|
||||||
my $generated = process_inline( $basictarget,
|
$generated = process_inline( $basictarget,
|
||||||
$chainref,
|
$chainref,
|
||||||
$prerule . $rule,
|
$prerule . $rule,
|
||||||
$matches1 . $raw_matches,
|
$matches1 . $raw_matches,
|
||||||
$loglevel,
|
$loglevel,
|
||||||
$target,
|
$target,
|
||||||
$param,
|
$param,
|
||||||
$source,
|
$source,
|
||||||
$dest,
|
$dest,
|
||||||
$proto,
|
$proto,
|
||||||
$ports,
|
$ports,
|
||||||
$sports,
|
$sports,
|
||||||
$origdest,
|
$origdest,
|
||||||
$ratelimit,
|
$ratelimit,
|
||||||
$user,
|
$user,
|
||||||
$mark,
|
$mark,
|
||||||
$connlimit,
|
$connlimit,
|
||||||
$time,
|
$time,
|
||||||
$headers,
|
$headers,
|
||||||
$condition,
|
$condition,
|
||||||
$helper,
|
$helper,
|
||||||
$wildcard ) || $actionresult;
|
$wildcard ) || $actionresult;
|
||||||
|
|
||||||
( $actionresult, @columns ) = @$savecolumns;;
|
( $actionresult, @columns ) = @$savecolumns;;
|
||||||
|
|
||||||
$macro_nest_level--;
|
$macro_nest_level--;
|
||||||
|
|
||||||
return $generated;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
# Generate Fixed part of the rule
|
# Generate Fixed part of the rule
|
||||||
@@ -3252,7 +3290,14 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
unless unreachable_warning( $wildcard || $section == DEFAULTACTION_SECTION, $chainref );
|
unless unreachable_warning( $wildcard || $section == DEFAULTACTION_SECTION, $chainref );
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
$generated = 1;
|
||||||
|
|
||||||
|
EXIT:
|
||||||
|
{
|
||||||
|
%nat_columns = %save_nat_columns;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $generated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3406,27 +3451,60 @@ sub perl_action_helper($$;$$) {
|
|||||||
'', # CurrentParam
|
'', # CurrentParam
|
||||||
@columns );
|
@columns );
|
||||||
} else {
|
} else {
|
||||||
$result = process_rule( $chainref,
|
if ( ( $targets{$target} || 0 ) & NATRULE ) {
|
||||||
$matches,
|
$result = process_rule( $chainref,
|
||||||
$matches1,
|
$matches,
|
||||||
merge_target( $actions{$action}, $target ),
|
$matches1,
|
||||||
'', # Current Param
|
merge_target( $actions{$action}, $target ),
|
||||||
'-', # Source
|
'', # Current Param
|
||||||
'-', # Dest
|
'-', # Source
|
||||||
'-', # Proto
|
merge_action_column( # Dest
|
||||||
'-', # Port(s)
|
$columns[2],
|
||||||
'-', # Source Port(s)
|
$nat_columns{dest}
|
||||||
'-', # Original Dest
|
),
|
||||||
'-', # Rate Limit
|
merge_action_column( #Proto
|
||||||
'-', # User
|
$columns[3],
|
||||||
'-', # Mark
|
$nat_columns{proto}
|
||||||
'-', # Connlimit
|
),
|
||||||
'-', # Time
|
merge_action_column( #Ports
|
||||||
'-', # Headers,
|
$columns[4],
|
||||||
'-', # condition,
|
$nat_columns{ports}),
|
||||||
'-', # helper,
|
'-', # Source Port(s)
|
||||||
0, # Wildcard
|
'-', # Original Dest
|
||||||
);
|
'-', # Rate Limit
|
||||||
|
'-', # User
|
||||||
|
'-', # Mark
|
||||||
|
'-', # Connlimit
|
||||||
|
'-', # Time
|
||||||
|
'-', # Headers,
|
||||||
|
'-', # condition,
|
||||||
|
'-', # helper,
|
||||||
|
0, # Wildcard
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$result = process_rule( $chainref,
|
||||||
|
$matches,
|
||||||
|
$matches1,
|
||||||
|
merge_target( $actions{$action}, $target ),
|
||||||
|
'', # Current Param
|
||||||
|
'-', # Source
|
||||||
|
'-', # Dest
|
||||||
|
'-', # Proto
|
||||||
|
'-', # Port(s)
|
||||||
|
'-', # Source Port(s)
|
||||||
|
'-', # Original Dest
|
||||||
|
'-', # Rate Limit
|
||||||
|
'-', # User
|
||||||
|
'-', # Mark
|
||||||
|
'-', # Connlimit
|
||||||
|
'-', # Time
|
||||||
|
'-', # Headers,
|
||||||
|
'-', # condition,
|
||||||
|
'-', # helper,
|
||||||
|
0, # Wildcard
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
allow_optimize( $chainref );
|
allow_optimize( $chainref );
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
@@ -3492,7 +3570,8 @@ sub perl_action_tcp_helper($$) {
|
|||||||
'-', # condition,
|
'-', # condition,
|
||||||
'-', # helper,
|
'-', # helper,
|
||||||
0, # Wildcard
|
0, # Wildcard
|
||||||
);
|
);
|
||||||
|
|
||||||
allow_optimize( $chainref );
|
allow_optimize( $chainref );
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
@@ -5286,7 +5365,7 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
$interfaces = $1;
|
$interfaces = $1;
|
||||||
} elsif ( $dest =~ /^([^:]+):([^:]*)$/ ) {
|
} elsif ( $dest =~ /^([^:]+):([^:]*)$/ ) {
|
||||||
my ( $one, $two ) = ( $1, $2 );
|
my ( $one, $two ) = ( $1, $2 );
|
||||||
if ( $2 =~ /\./ || $2 =~ /^%/ ) {
|
if ( $2 =~ /\./ || $2 =~ /^[+%!]/ ) {
|
||||||
$interfaces = $one;
|
$interfaces = $one;
|
||||||
$destnets = $two;
|
$destnets = $two;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -421,7 +421,7 @@ restore_default_route() # $1 = USE_DEFAULT_RT
|
|||||||
conditionally_flush_conntrack() {
|
conditionally_flush_conntrack() {
|
||||||
|
|
||||||
if [ -n "$g_purge" ]; then
|
if [ -n "$g_purge" ]; then
|
||||||
if [ -n $(mywhich conntrack) ]; then
|
if [ -n "$(mywhich conntrack)" ]; then
|
||||||
conntrack -F
|
conntrack -F
|
||||||
else
|
else
|
||||||
error_message "WARNING: The '-p' option requires the conntrack utility which does not appear to be installed on this system"
|
error_message "WARNING: The '-p' option requires the conntrack utility which does not appear to be installed on this system"
|
||||||
@@ -899,7 +899,7 @@ detect_dynamic_gateway() { # $1 = interface
|
|||||||
#
|
#
|
||||||
# Detect the gateway through an interface
|
# Detect the gateway through an interface
|
||||||
#
|
#
|
||||||
detect_gateway() # $1 = interface
|
detect_gateway() # $1 = interface $2 = table number
|
||||||
{
|
{
|
||||||
local interface
|
local interface
|
||||||
interface=$1
|
interface=$1
|
||||||
@@ -912,6 +912,8 @@ detect_gateway() # $1 = interface
|
|||||||
# Maybe there's a default route through this gateway already
|
# Maybe there's a default route through this gateway already
|
||||||
#
|
#
|
||||||
[ -n "$gateway" ] || gateway=$(find_gateway $($IP -4 route list dev $interface | grep ^default))
|
[ -n "$gateway" ] || gateway=$(find_gateway $($IP -4 route list dev $interface | grep ^default))
|
||||||
|
|
||||||
|
[ -z "$gateway" -a -n "$2" ] && gateway=$(find_gateway $($IP -4 route list dev $interface table $2 | grep ^default))
|
||||||
#
|
#
|
||||||
# Last hope -- is there a load-balancing route through the interface?
|
# Last hope -- is there a load-balancing route through the interface?
|
||||||
#
|
#
|
||||||
|
@@ -205,8 +205,6 @@ MINIUPNPD=No
|
|||||||
|
|
||||||
MARK_IN_FORWARD_CHAIN=No
|
MARK_IN_FORWARD_CHAIN=No
|
||||||
|
|
||||||
MODULE_SUFFIX="ko ko.xz"
|
|
||||||
|
|
||||||
MULTICAST=No
|
MULTICAST=No
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
|
@@ -216,8 +216,6 @@ MINIUPNPD=No
|
|||||||
|
|
||||||
MARK_IN_FORWARD_CHAIN=No
|
MARK_IN_FORWARD_CHAIN=No
|
||||||
|
|
||||||
MODULE_SUFFIX="ko ko.xz"
|
|
||||||
|
|
||||||
MULTICAST=No
|
MULTICAST=No
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
|
@@ -213,8 +213,6 @@ MINIUPNPD=No
|
|||||||
|
|
||||||
MARK_IN_FORWARD_CHAIN=No
|
MARK_IN_FORWARD_CHAIN=No
|
||||||
|
|
||||||
MODULE_SUFFIX="ko ko.xz"
|
|
||||||
|
|
||||||
MULTICAST=No
|
MULTICAST=No
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
|
@@ -216,8 +216,6 @@ MINIUPNPD=No
|
|||||||
|
|
||||||
MARK_IN_FORWARD_CHAIN=No
|
MARK_IN_FORWARD_CHAIN=No
|
||||||
|
|
||||||
MODULE_SUFFIX="ko ko.xz"
|
|
||||||
|
|
||||||
MULTICAST=No
|
MULTICAST=No
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
|
@@ -205,8 +205,6 @@ MARK_IN_FORWARD_CHAIN=No
|
|||||||
|
|
||||||
MINIUPNPD=No
|
MINIUPNPD=No
|
||||||
|
|
||||||
MODULE_SUFFIX=ko
|
|
||||||
|
|
||||||
MULTICAST=No
|
MULTICAST=No
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
|
@@ -1556,10 +1556,10 @@ remote_reload_command() # $* = original arguments less the command.
|
|||||||
|
|
||||||
progress_message "Getting Capabilities on system $system..."
|
progress_message "Getting Capabilities on system $system..."
|
||||||
if [ $g_family -eq 4 ]; then
|
if [ $g_family -eq 4 ]; then
|
||||||
if ! rsh_command "MODULESDIR=$MODULESDIR MODULE_SUFFIX=\"$MODULE_SUFFIX\" IPTABLES=$IPTABLES DONT_LOAD=\"$DONT_LOAD\" $libexec/shorewall-lite/shorecap" > $g_shorewalldir/capabilities; then
|
if ! rsh_command "MODULESDIR=$MODULESDIR IPTABLES=$IPTABLES DONT_LOAD=\"$DONT_LOAD\" $libexec/shorewall-lite/shorecap" > $g_shorewalldir/capabilities; then
|
||||||
fatal_error "Capturing capabilities on system $system failed"
|
fatal_error "Capturing capabilities on system $system failed"
|
||||||
fi
|
fi
|
||||||
elif ! rsh_command "MODULESDIR=$MODULESDIR MODULE_SUFFIX=\"$MODULE_SUFFIX\" IP6TABLES=$IP6TABLES DONT_LOAD=\"$DONT_LOAD\" $libexec/shorewall6-lite/shorecap" > $g_shorewalldir/capabilities; then
|
elif ! rsh_command "MODULESDIR=$MODULESDIR IP6TABLES=$IP6TABLES DONT_LOAD=\"$DONT_LOAD\" $libexec/shorewall6-lite/shorecap" > $g_shorewalldir/capabilities; then
|
||||||
fatal_error "Capturing capabilities on system $system failed"
|
fatal_error "Capturing capabilities on system $system failed"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
<para>The <replaceable>modulename</replaceable> names a kernel module
|
<para>The <replaceable>modulename</replaceable> names a kernel module
|
||||||
(without suffix). Shorewall will search for modules based on your
|
(without suffix). Shorewall will search for modules based on your
|
||||||
MODULESDIR and MODULE_SUFFIX settings in <ulink
|
MODULESDIR setting in <ulink
|
||||||
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(8). The
|
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(8). The
|
||||||
<replaceable>moduleoption</replaceable>s are passed to modprobe (if
|
<replaceable>moduleoption</replaceable>s are passed to modprobe (if
|
||||||
installed) or to insmod.</para>
|
installed) or to insmod.</para>
|
||||||
|
@@ -673,7 +673,7 @@
|
|||||||
address changed to 206.124.146.177.</para>
|
address changed to 206.124.146.177.</para>
|
||||||
|
|
||||||
<programlisting> #ACTION SOURCE DEST
|
<programlisting> #ACTION SOURCE DEST
|
||||||
SNAT(206.124.146.177) - eth0+myset[dst]</programlisting>
|
SNAT(206.124.146.177) - eth0:+myset[dst]</programlisting>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
@@ -1892,18 +1892,6 @@ LOG:info:,bar net fw</programlisting>
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">MODULE_SUFFIX=</emphasis>[<emphasis
|
|
||||||
role="bold">"</emphasis><emphasis>extension</emphasis> ...<emphasis
|
|
||||||
role="bold">"</emphasis>]</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>The value of this option determines the possible file
|
|
||||||
extensions of kernel modules. The default value is "ko ko.gz ko.xz o
|
|
||||||
o.gz o.xz gz xz".</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis
|
<term><emphasis
|
||||||
role="bold">MODULESDIR=</emphasis>[[+]<emphasis>pathname</emphasis>[<emphasis
|
role="bold">MODULESDIR=</emphasis>[[+]<emphasis>pathname</emphasis>[<emphasis
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#
|
#
|
||||||
# On the target system (the system where the firewall program is to run):
|
# On the target system (the system where the firewall program is to run):
|
||||||
#
|
#
|
||||||
# [ IPTABLES=<iptables binary> ] [ MODULESDIR=<kernel modules directory> ] [ MODULE_SUFFIX="<module suffix list>" ] shorecap > capabilities
|
# [ IPTABLES=<iptables binary> ] [ MODULESDIR=<kernel modules directory> ] shorecap > capabilities
|
||||||
#
|
#
|
||||||
# Now move the capabilities file to the compilation system. The file must
|
# Now move the capabilities file to the compilation system. The file must
|
||||||
# be placed in a directory on the CONFIG_PATH to be used when compiling firewalls
|
# be placed in a directory on the CONFIG_PATH to be used when compiling firewalls
|
||||||
@@ -38,7 +38,6 @@
|
|||||||
#
|
#
|
||||||
# IPTABLES - iptables
|
# IPTABLES - iptables
|
||||||
# MODULESDIR - /lib/modules/$(uname -r)/kernel/net/ipv4/netfilter
|
# MODULESDIR - /lib/modules/$(uname -r)/kernel/net/ipv4/netfilter
|
||||||
# MODULE_SUFFIX - "o gz xz ko o.gz o.xz ko.gz ko.xz"
|
|
||||||
#
|
#
|
||||||
# Shorewall need not be installed on the target system to run shorecap. If the '-e' flag is
|
# Shorewall need not be installed on the target system to run shorecap. If the '-e' flag is
|
||||||
# used during firewall compilation, then the generated firewall program will likewise not
|
# used during firewall compilation, then the generated firewall program will likewise not
|
||||||
|
@@ -190,8 +190,6 @@ MARK_IN_FORWARD_CHAIN=No
|
|||||||
|
|
||||||
MINIUPNPD=No
|
MINIUPNPD=No
|
||||||
|
|
||||||
MODULE_SUFFIX="ko ko.xz"
|
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
|
|
||||||
OPTIMIZE=All
|
OPTIMIZE=All
|
||||||
|
@@ -191,8 +191,6 @@ MARK_IN_FORWARD_CHAIN=No
|
|||||||
|
|
||||||
MINIUPNPD=No
|
MINIUPNPD=No
|
||||||
|
|
||||||
MODULE_SUFFIX="ko ko.xz"
|
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
|
|
||||||
OPTIMIZE=All
|
OPTIMIZE=All
|
||||||
|
@@ -190,8 +190,6 @@ MARK_IN_FORWARD_CHAIN=No
|
|||||||
|
|
||||||
MINIUPNPD=No
|
MINIUPNPD=No
|
||||||
|
|
||||||
MODULE_SUFFIX="ko ko.xz"
|
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
|
|
||||||
OPTIMIZE=All
|
OPTIMIZE=All
|
||||||
|
@@ -190,8 +190,6 @@ MARK_IN_FORWARD_CHAIN=No
|
|||||||
|
|
||||||
MINIUPNPD=No
|
MINIUPNPD=No
|
||||||
|
|
||||||
MODULE_SUFFIX="ko ko.xz"
|
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
|
|
||||||
OPTIMIZE=All
|
OPTIMIZE=All
|
||||||
|
@@ -190,8 +190,6 @@ MARK_IN_FORWARD_CHAIN=No
|
|||||||
|
|
||||||
MINIUPNPD=No
|
MINIUPNPD=No
|
||||||
|
|
||||||
MODULE_SUFFIX=ko
|
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
|
|
||||||
OPTIMIZE=All
|
OPTIMIZE=All
|
||||||
|
@@ -253,7 +253,7 @@ eth0:0 192.168.1.0/24 206.124.146.178-206.124.146.180</program
|
|||||||
<filename>/etc/shorewall/snat</filename> is:</para>
|
<filename>/etc/shorewall/snat</filename> is:</para>
|
||||||
|
|
||||||
<programlisting>#ACTION SOURCE DEST PROTO PORT
|
<programlisting>#ACTION SOURCE DEST PROTO PORT
|
||||||
SNAT(206.124.146.178-206.24.146.80) 192.168.1.0/24 eth0</programlisting>
|
SNAT(206.124.146.178-206.24.146.180) 192.168.1.0/24 eth0</programlisting>
|
||||||
|
|
||||||
<para>The above would create three IP addresses:</para>
|
<para>The above would create three IP addresses:</para>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user