Set default-route on 18.06.5

thats I need:
default route to GW


root@OpenWrt:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         UG    0      0        0 br-4     *        U     0      0        0 br-1     *        U     0      0        0 br-2     *        U     0      0        0 br-3     *        U     0      0        0 br-4     *        U     0      0        0 br-5     *        U     0      0        0 br-6

I have no idea where the default route comes from. is entered in the interface br-4 as GW. In the other networks, however, the x.x.x.254 is also entered as GW.
„route add default gw br-1“ works. Then, there are two defaultsroute.

In „/etc/config/network“, there is one route

config route 'default'
        option interface 'lan'
        option gateway ''
        option target ''
        option netmask ''

„lan“ is on the br-1.

You should be able to configure multiple default routes (gateways) if you give them different metrics using the advanced setting "Use gateway metric". Though linux will only use the default route with the lowest metric.

Maybe you should explain why you need multiple default IPv4 routes? You may need to use policy routing, mwan3 or similar.

thats not the point. My problem is, that I need the default-GW but is set by the system after boot.

Try to add metric:

Then remove from all configs and/or DHCP replies. Simple.

after I have entered a metric for all interfaces (and the lowest for br-1) the routing works.
Sorry that I didn't read carefully at first.
Note: now I have many default routes. It's not nice, but it works.
Thanks a lot!

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

If you use DHCP then you should uncheck "Use default gateway" on interfaces you don't want to use as default gateway.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.