Static route with default gateway IP receive from interface

Hello,
Is it possible to set the IP address of gateway the same as IP of default gw of interface. The default gateway recieive from dhcp and may vary. For example:

config route
         option interface 'wwan'
         option gateway `get-default-gateway-IP-from-wwan-interface`
         option target '0.0.0.0'
         option netmask '0.0.0.0'
         option table 'myTable'
config route
         option interface 'wwan'
         option gateway `get-default-gateway-IP-from-wwan-interface`
         option target '198.18.0.0'
         option netmask '255.255.0.0'

While I am using /etc/udhcpc.user script with:

ip route add default via "$i" table myTable &> /dev/null
ip route add 198.18.0.0/24 via "$i" &> /dev/null

But I want to abandon to use the custom scripts.

Hello,
Is there any information on the matter?

Did you try to just omit the option gateway setting of your static route? Iirc this should infer the gateway from the referenced option interface.

Tried, as result:

# ip route show 198.18.0.0/16
198.18.0.0/16 dev wlan1

The route is without IP gateway and I see the arp requests for hosts in the 198.18.0.0/1 network.

Which script is run when static route inplement from /etc/config/network?

Hi,
I am also facing this issue. When I leave out the gateway value for a route in /etc/config/network the gateway of the parent interface is supposed to be selected. Unfortunately, this does not work for me. Also in my case, the wan interface receives its gateway via DHCP.

Any workaround for this?