Are you connecting to multiple access points, have multiple addresses, but a
single gateway, and you want to change the gateway to switch the AP used
to reach the internet?
There are two interfaces picking up a DHCP IP. Only the wired interface is default but the wireless interface also picks up a DHCP IP and is what I manually switch to when needed. No need for multiple routes, I'm just switching between routes as needed.
you could take down the interface it's using currently as WAN, and restart the wifi
interface used for your WWAN, and voila, you'd be using your alternative route.
What I cannot seem to find a clear answer to is how to set the default route for this router.
Let me try to explain again.
For example, eth0 is getting a DHCP IP from a wired connection and the DHCP server on that network while the wifi is getting a DHCP IP from the AP which is on a different network.
The default route is the wired interface.
Once they both have a DHCP IP, it's simple to swap routes but how do I manually set which I want to be default? For example, to go from the wired network which has a gateway of 192.168.1.1 to the wifi network which has a gateway of 192.168.0.1, I use the following.
ip route change default via 192.168.0.1 dev wlan0
To go back, I just change the gw IP and interface name.
Now, if I wanted to make the wireless the default network on bootup, how do I do that?
More importantly, what if the wifi becomes unavailable, would the router automatically pick the wired connection or would it just stop communicating.
Someone had suggested using
set option metric 10 to assign a higher metric to one of the interfaces but I want to make sure I know what I'm doing before doing it.