What is the service that refresh default gateway?

I have a device with two interfaces: eth0 and wlan0, and I want only local data to go through LAN and all external data go through WLAN. The default gateway only has LAN, so I added WLAN as default gateway and removed LAN from default gateway. Then it works for a while, all is ok. After just few minutes, the WLAN default gateway disappears, and the LAN default gateway comes back.
My other computers with Ubuntu won’t behave like this, or this fast, maybe about 12h later when the DHCP lease is over.
So why does CoreELEC refresh default gateway this fast? Can I do something to slow it down or even shut it down?
Thanks!

The version is CoreELEC (official): 9.2.2 (Amlogic-ng.arm)

How did you change the configuration? CoreELEC uses connman to handle network configuration. So it’s possible depending on how you tried to make the change that the change back to original settings is caused by connman resetting back to it’s settings.

1 Like

I used route del and route add to modify route rules directly. So this must be the reason.
The command

connmanctl move-before wifi_xxxx_managed_none ethernet_xxxx_cable

works temporarily like route.
Then I copied /etc/connman/main.conf to /storage/.config/connman_main.conf and changed the following line to

PreferredTechnologies = wifi,ethernet,cellular

and then reboot, but it doesn’t work. ps | grep connman shows that connman is using this config file:
root 0:00 /usr/sbin/connmand -nr --config=/storage/.config/connman_main.conf

I don’t know what to do…
Thanks!!