diff --git a/Shorewall-perl/Shorewall/Providers.pm b/Shorewall-perl/Shorewall/Providers.pm index bcdca5df3..92f333bf5 100644 --- a/Shorewall-perl/Shorewall/Providers.pm +++ b/Shorewall-perl/Shorewall/Providers.pm @@ -187,8 +187,7 @@ sub setup_providers() { $gateway = '$gateway'; } elsif ( $gateway && $gateway ne '-' ) { validate_address $gateway; - my $variable = get_interface_address $interface; - emit "run_ip route replace $gateway src $variable dev $interface table $number"; + emit "run_ip route replace $gateway src \$(find_first_interface_address $interface) dev $interface table $number"; emit "run_ip route add default via $gateway dev $interface table $number"; } else { $gateway = '';