diff --git a/Shorewall/Perl/Shorewall/Providers.pm b/Shorewall/Perl/Shorewall/Providers.pm index b076c3c1a..96b6e80fb 100644 --- a/Shorewall/Perl/Shorewall/Providers.pm +++ b/Shorewall/Perl/Shorewall/Providers.pm @@ -642,7 +642,7 @@ sub add_an_rtrule( ) { } 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; @@ -668,7 +668,9 @@ sub add_a_route( ) { 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} ) { my $base = uc chain_base( $physical ); @@ -679,9 +681,11 @@ sub add_a_route( ) { } if ( $gateway ne '-' ) { - emit( "if ! qt \$IP route -4 add $dest via $gateway dev $physical table $number; then", - " run_ip route add $dest via $gateway table $number", - "fi" ); + if ( $device ne '-' ) { + emit( "run_ip route add $dest via $gateway dev $physical table $number" ); + } else { + emit ("run_ip route add $dest via $gateway table $number" ); + } } else { emit( "run_ip route add $dest dev $physical table $number" ); } diff --git a/Shorewall/configfiles/routes b/Shorewall/configfiles/routes index 8389df849..db3d780a3 100644 --- a/Shorewall/configfiles/routes +++ b/Shorewall/configfiles/routes @@ -5,4 +5,5 @@ # # For additional information, see http://www.shorewall.net/MultiISP.html ############################################################################## -#PROVIDER DEST GATEWAY +#PROVIDER DEST GATEWAY DEVICE + diff --git a/Shorewall6/routes b/Shorewall6/routes new file mode 100644 index 000000000..650bf006d --- /dev/null +++ b/Shorewall6/routes @@ -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 + diff --git a/manpages/shorewall-routes.xml b/manpages/shorewall-routes.xml index c339b5cf4..77a12e239 100644 --- a/manpages/shorewall-routes.xml +++ b/manpages/shorewall-routes.xml @@ -55,6 +55,17 @@ DEST. + + + DEVICE (Optional) + + + Specifies the device route. If neither DEVICE nor GATEWAY is + given, then the INTERFACE specified for the PROVIDER in shorewall-providers + (5). + + diff --git a/manpages6/shorewall6-routes.xml b/manpages6/shorewall6-routes.xml index 9251d2b7a..0b297d850 100644 --- a/manpages6/shorewall6-routes.xml +++ b/manpages6/shorewall6-routes.xml @@ -55,6 +55,17 @@ DEST. + + + DEVICE (Optional) + + + Specifies the device route. If neither DEVICE nor GATEWAY is + given, then the INTERFACE specified for the PROVIDER in shorewall6-providers + (5). + +