forked from extern/shorewall_code
Add DEVICE column to routes file
This commit is contained in:
parent
421b1e745d
commit
5e1c8f8d2a
@ -642,7 +642,7 @@ sub add_an_rtrule( ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub add_a_route( ) {
|
sub add_a_route( ) {
|
||||||
my ( $provider, $dest, $gateway ) = split_line 2, 3, 'routes file';
|
my ( $provider, $dest, $gateway, $device ) = split_line 2, 4, 'routes file';
|
||||||
|
|
||||||
our $current_if;
|
our $current_if;
|
||||||
|
|
||||||
@ -668,7 +668,9 @@ sub add_a_route( ) {
|
|||||||
|
|
||||||
validate_address ( $gateway, 1 ) if $gateway ne '-';
|
validate_address ( $gateway, 1 ) if $gateway ne '-';
|
||||||
|
|
||||||
my ( $optional, $number , $physical ) = ( $providers{$provider}{optional} , $providers{$provider}{number}, $providers{$provider}{physical} );
|
my ( $optional, $number ) = ( $providers{$provider}{optional} , $providers{$provider}{number} );
|
||||||
|
|
||||||
|
my $physical = $device eq '-' ? $providers{$provider}{physical} : physical_name( $device );
|
||||||
|
|
||||||
if ( $providers{$provider}{optional} ) {
|
if ( $providers{$provider}{optional} ) {
|
||||||
my $base = uc chain_base( $physical );
|
my $base = uc chain_base( $physical );
|
||||||
@ -679,9 +681,11 @@ sub add_a_route( ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $gateway ne '-' ) {
|
if ( $gateway ne '-' ) {
|
||||||
emit( "if ! qt \$IP route -4 add $dest via $gateway dev $physical table $number; then",
|
if ( $device ne '-' ) {
|
||||||
" run_ip route add $dest via $gateway table $number",
|
emit( "run_ip route add $dest via $gateway dev $physical table $number" );
|
||||||
"fi" );
|
} else {
|
||||||
|
emit ("run_ip route add $dest via $gateway table $number" );
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
emit( "run_ip route add $dest dev $physical table $number" );
|
emit( "run_ip route add $dest dev $physical table $number" );
|
||||||
}
|
}
|
||||||
|
@ -5,4 +5,5 @@
|
|||||||
#
|
#
|
||||||
# For additional information, see http://www.shorewall.net/MultiISP.html
|
# For additional information, see http://www.shorewall.net/MultiISP.html
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#PROVIDER DEST GATEWAY
|
#PROVIDER DEST GATEWAY DEVICE
|
||||||
|
|
||||||
|
9
Shorewall6/routes
Normal file
9
Shorewall6/routes
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#
|
||||||
|
# Shorewall6 version 4 - routes File
|
||||||
|
#
|
||||||
|
# For information about entries in this file, type "man shorewall6-routes"
|
||||||
|
#
|
||||||
|
# For additional information, see http://www.shorewall.net/MultiISP.html
|
||||||
|
##############################################################################
|
||||||
|
#PROVIDER DEST GATEWAY DEVICE
|
||||||
|
|
@ -55,6 +55,17 @@
|
|||||||
DEST.</para>
|
DEST.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>DEVICE (Optional)</term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Specifies the device route. If neither DEVICE nor GATEWAY is
|
||||||
|
given, then the INTERFACE specified for the PROVIDER in <ulink
|
||||||
|
url="shorewall-providers.html">shorewall-providers</ulink>
|
||||||
|
(5).</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -55,6 +55,17 @@
|
|||||||
DEST.</para>
|
DEST.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>DEVICE (Optional)</term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Specifies the device route. If neither DEVICE nor GATEWAY is
|
||||||
|
given, then the INTERFACE specified for the PROVIDER in <ulink
|
||||||
|
url="shorewall6-providers.html">shorewall6-providers</ulink>
|
||||||
|
(5).</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user