diff --git a/Shorewall/Perl/lib.core b/Shorewall/Perl/lib.core index 3a3167db8..ea554a637 100644 --- a/Shorewall/Perl/lib.core +++ b/Shorewall/Perl/lib.core @@ -916,7 +916,12 @@ add_gateway() # $1 = Delta $2 = Table Number delta=$1 if ! echo $route | fgrep -q ' nexthop '; then - route=`echo $route | sed 's/via/nexthop via/'` + if echo $route | fgrep -q via; then + route=`echo $route | sed 's/via/nexthop via/'` + else + route="nexthop $route" + fi + dev=$(find_device $route) if [ -f ${VARDIR}/${dev}_weight ]; then weight=`cat ${VARDIR}/${dev}_weight`