mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-09 07:08:14 +01:00
Make BALANCE_PROVIDERS default the setting of USE_DEFAULT_RT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
ac5fd195ec
commit
cc3b8793e0
@ -5280,7 +5280,13 @@ sub update_config_file( $ ) {
|
||||
}
|
||||
|
||||
update_default( 'USE_DEFAULT_RT', 'No' );
|
||||
update_default( 'BALANCE_PROVIDERS', 'Yes' );
|
||||
|
||||
if ( $config{USE_DEFAULT_RT} eq '' || $config{USE_DEFAULT_RT} =~ /^no$/i ) {
|
||||
update_default( 'BALANCE_PROVIDERS', 'No' );
|
||||
} else {
|
||||
update_default( 'BALANCE_PROVIDERS', 'Yes' );
|
||||
}
|
||||
|
||||
update_default( 'EXPORTMODULES', 'No' );
|
||||
update_default( 'RESTART', 'reload' );
|
||||
update_default( 'PAGER', $shorewallrc1{DEFAULT_PAGER} );
|
||||
@ -6288,9 +6294,7 @@ sub get_configuration( $$$$ ) {
|
||||
default_yes_no 'RESTORE_DEFAULT_ROUTE' , 'Yes';
|
||||
default_yes_no 'AUTOMAKE' , '';
|
||||
default_yes_no 'TRACK_PROVIDERS' , '';
|
||||
default_yes_no 'BALANCE_PROVIDERS' , 'Yes';
|
||||
|
||||
$config{BALANCE_PROVIDERS} = '' unless $config{USE_DEFAULT_RT};
|
||||
default_yes_no 'BALANCE_PROVIDERS' , $config{USE_DEFAULT_RT} ? 'Yes' : '';
|
||||
|
||||
unless ( ( $config{NULL_ROUTE_RFC1918} || '' ) =~ /^(?:blackhole|unreachable|prohibit)$/ ) {
|
||||
default_yes_no( 'NULL_ROUTE_RFC1918', '' );
|
||||
|
@ -603,39 +603,39 @@ sub process_a_provider( $ ) {
|
||||
|
||||
fatal_error "A provider interface must have at least one associated zone" unless $tproxy || %{interface_zones($interface)};
|
||||
|
||||
if ( $local ) {
|
||||
fatal_error "GATEWAY not valid with 'local' provider" unless $gatewaycase eq 'omitted';
|
||||
fatal_error "'track' not valid with 'local'" if $track;
|
||||
fatal_error "DUPLICATE not valid with 'local'" if $duplicate ne '-';
|
||||
fatal_error "'persistent' is not valid with 'local" if $persistent;
|
||||
} elsif ( $tproxy ) {
|
||||
fatal_error "Only one 'tproxy' provider is allowed" if $tproxies++;
|
||||
fatal_error "GATEWAY not valid with 'tproxy' provider" unless $gatewaycase eq 'omitted';
|
||||
fatal_error "'track' not valid with 'tproxy'" if $track;
|
||||
fatal_error "DUPLICATE not valid with 'tproxy'" if $duplicate ne '-';
|
||||
fatal_error "MARK not allowed with 'tproxy'" if $mark ne '-';
|
||||
fatal_error "'persistent' is not valid with 'tproxy" if $persistent;
|
||||
$mark = $globals{TPROXY_MARK};
|
||||
} elsif ( ! $pseudo && ( ( my $rf = ( $config{ROUTE_FILTER} eq 'on' ) ) || $interfaceref->{options}{routefilter} ) ) {
|
||||
if ( $config{USE_DEFAULT_RT} ) {
|
||||
if ( $rf ) {
|
||||
fatal_error "There may be no providers when ROUTE_FILTER=Yes and USE_DEFAULT_RT=Yes";
|
||||
} else {
|
||||
fatal_error "Providers interfaces may not specify 'routefilter' when USE_DEFAULT_RT=Yes";
|
||||
}
|
||||
} else {
|
||||
unless ( $balance ) {
|
||||
unless ( $pseudo ) {
|
||||
if ( $local ) {
|
||||
fatal_error "GATEWAY not valid with 'local' provider" unless $gatewaycase eq 'omitted';
|
||||
fatal_error "'track' not valid with 'local'" if $track;
|
||||
fatal_error "DUPLICATE not valid with 'local'" if $duplicate ne '-';
|
||||
fatal_error "'persistent' is not valid with 'local" if $persistent;
|
||||
} elsif ( $tproxy ) {
|
||||
fatal_error "Only one 'tproxy' provider is allowed" if $tproxies++;
|
||||
fatal_error "GATEWAY not valid with 'tproxy' provider" unless $gatewaycase eq 'omitted';
|
||||
fatal_error "'track' not valid with 'tproxy'" if $track;
|
||||
fatal_error "DUPLICATE not valid with 'tproxy'" if $duplicate ne '-';
|
||||
fatal_error "MARK not allowed with 'tproxy'" if $mark ne '-';
|
||||
fatal_error "'persistent' is not valid with 'tproxy" if $persistent;
|
||||
$mark = $globals{TPROXY_MARK};
|
||||
} elsif ( ( my $rf = ( $config{ROUTE_FILTER} eq 'on' ) ) || $interfaceref->{options}{routefilter} ) {
|
||||
if ( $config{USE_DEFAULT_RT} ) {
|
||||
if ( $rf ) {
|
||||
fatal_error "The 'balance' option is required when ROUTE_FILTER=Yes";
|
||||
fatal_error "There may be no providers when ROUTE_FILTER=Yes and USE_DEFAULT_RT=Yes";
|
||||
} else {
|
||||
fatal_error "Provider interfaces may not specify 'routefilter' without 'balance' or 'primary'";
|
||||
fatal_error "Providers interfaces may not specify 'routefilter' when USE_DEFAULT_RT=Yes";
|
||||
}
|
||||
} else {
|
||||
unless ( $balance ) {
|
||||
if ( $rf ) {
|
||||
fatal_error "The 'balance' option is required when ROUTE_FILTER=Yes";
|
||||
} else {
|
||||
fatal_error "Provider interfaces may not specify 'routefilter' without 'balance' or 'primary'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
my $val = 0;
|
||||
my $pref;
|
||||
|
||||
|
@ -208,6 +208,16 @@
|
||||
<option>balance=</option><replaceable>weight</replaceable>
|
||||
where <replaceable>weight</replaceable> is the weight of the
|
||||
route out of this interface.</para>
|
||||
|
||||
<para>Prior to Shorewall 5.1.1, when USE_DEFAULT_RT=Yes,
|
||||
<option>balance=1</option> is assumed unless the
|
||||
<option>fallback</option>, <option>loose</option>,
|
||||
<option>load</option> or <option>tproxy</option> option is
|
||||
specified. Beginning with Shorewall 5.1.1, when
|
||||
BALANCE_PROVIDERS=Yes, <option>balance=1</option> is assumed
|
||||
unless the <option>fallback</option>, <option>loose</option>,
|
||||
<option>load</option> or <option>tproxy</option> option is
|
||||
specified.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -452,11 +452,12 @@
|
||||
determines whether the <option>balance</option> provider option (see
|
||||
<ulink
|
||||
url="shorewall-providers.html">shorewall-providers(5)</ulink>) is
|
||||
the default. When BALANCE_PROVIDERS=Yes (the default), then the
|
||||
the default. When BALANCE_PROVIDERS=Yes, then the
|
||||
<option>balance</option> option is assumed unless the
|
||||
<option>fallback</option>, <option>loose</option>,
|
||||
<option>load</option> or <option>tproxy</option> option is
|
||||
specified.</para>
|
||||
specified. If this option is not set or is set to the empty value,
|
||||
then the default value is the value of USE_DEFAULT_RT.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -173,6 +173,16 @@
|
||||
where <replaceable>weight</replaceable> is the weight of the
|
||||
route out of this interface. Prior to Shorewall 5.0.13, only
|
||||
one provider can specify this option.</para>
|
||||
|
||||
<para>Prior to Shorewall 5.1.1, when USE_DEFAULT_RT=Yes,
|
||||
<option>balance=1</option> is assumed unless the
|
||||
<option>fallback</option>, <option>loose</option>,
|
||||
<option>load</option> or <option>tproxy</option> option is
|
||||
specified. Beginning with Shorewall 5.1.1, when
|
||||
BALANCE_PROVIDERS=Yes, <option>balance=1</option> is assumed
|
||||
unless the <option>fallback</option>, <option>loose</option>,
|
||||
<option>load</option> or <option>tproxy</option> option is
|
||||
specified.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -383,11 +383,12 @@
|
||||
determines whether the <option>balance</option> provider option (see
|
||||
<ulink
|
||||
url="shorewall6-providers.html">shorewall6-providers(5)</ulink>) is
|
||||
the default. When BALANCE_PROVIDERS=Yes (the default), then the
|
||||
the default. When BALANCE_PROVIDERS=Yes, then the
|
||||
<option>balance</option> option is assumed unless the
|
||||
<option>fallback</option>, <option>loose</option>,
|
||||
<option>load</option> or <option>tproxy</option> option is
|
||||
specified.</para>
|
||||
specified. If this option is not set or is set to the empty value,
|
||||
then the default value is the value of USE_DEFAULT_RT.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user