How can I switch the default route from the command line so that when the router restarts, it goes back to the wired interface as the default.
Example;
Router starts, default route is always wired Ethernet.
Enable wifi from command line.
Switch the route from wired gateway to wifi gateway.
Can it be done in a temporary way so that the default if I lose access would be to restart the router and have it use wired again. Or maybe I can set the default in rc.local?
Thanks for the input, unfortunately, the very short replies don't explain things so that I can understand.
For example, my default route/gateway when wired is interface br-wan 192.168.1.1.
Once I activate the wifi, its gateway is 192.168.0.1 on interface wlan0.
Now I can change the default route using;
ip route change default via 192.168.0.1 dev wlan0
And, if I wanted to change it back to wired,
ip route change default via 192.168.1.1 dev br-wan
First, is this correct above?
Second, you said avoid rc.local. I think I read that there is an option I could put into the 'network' file which would make one of the interfaces the default on reboot.
However, I've yet to find such an option.
I'm asking for clarification so that I can understand rather than just trying things and not really learning how this works.