I have been trying to setup OpenWrt on a router with two Internet connections, an eth wan and a lte redundancy modem. The interfaces are working correctly, but upon reboot the system seems to create gateways randomly in the routing table. Sometimes it creates two gateways, one for each interface, sometimes it creates a gateway for just one interface, seemly at random. Both interfaces are assigned IPs and, when I manually set up the routing table, work correctly, .
LuCi is disabled on this particular installation, I am configuring via /etc/ files mostly.
Can someone shed some light on why the OS is setting up the routing table in such erratic way?
If I understand this correctly, this one is for static gateway routes, ie. I would need to know the gateway addresses beforehand. All my gateways/addresses change after each reboot, so I don't think this one would apply?
uci -q delete network.route1
uci set network.lwan.ip4table="1"
uci set network.lwan.ip6table="1"
uci commit network
sleep 10; ip route show table all; ip rule show; ip -6 rule show
Adding ip4table/ip6table to the wwan changed nothing. However, running /etc/init.d/network restart after some time added the missing gateways. That tells me the interfaces are not online when the system starts, and therefore are not added. Also udhcpc is not working properly, since it should add the gateways later as the DHCP procedure completes.
There is another issue bugging me though. After restarting the network service, ip show route gives me this:
default via 220.127.116.11 dev wwan0 proto static src X.X.X.X
default via 192.168.15.1 dev eth4 proto static src Y.Y.Y.Y metric 1
The metrics clearly do not match the ones in /etc/config/network. Any ideas?
I will dig into the udhcpc script to find what is going on with the gateways.
It is the openwrt QSDK uses actually and, since there is no official support to IPQ807x, upgrading right now would require a lot of effort to port everything. Maybe in the future, if I have time.
Regarding the problem itself, I am stuck, udhcpc requests the gateway correctly, but the system refuses, I would have to debug the kernel to find the cause probably. So I just added a crontab to call network restart whenever the gateway is missing, and restarting mwan. It is working fine for now.