My fiber connection has grown unreliable. I'm having to disconnect/reconnect my laptop from my LAN and tether/untether to my phone multiple times a day. This is a manual operation. I'd like to automate it more.
What I'd like to do is remove the default gateway info from the DHCP service and instead rely on a dynamic routing protocol that automatically advertises a route to the internet when my PPPoE connection is up, and stops when it is down. The problem is I don't know what to do or where to start.
Can anyone help me set this up? Thanks!
update: Clarified that I'm switching my laptop's connection between phone and LAN as my fiber internet connection goes down and up.
I want to keep my phone nearby, which means I don't want to leave it connected to my router. So, I want to connect it to my laptop, but I want my laptop to have up-to-date information about the WAN connectivity of my router so it can make good routing decisions on its own.
I've figured out how to prevent the DHCP server from supplying a default gateway (add "list dhcp_option '3'" to the config dnsmasq section of /etc/config/dnsmasq.
Unfortunately it doesn't look like its advertising IPv4 routes. I'm not sure how to enable that.
Option 3 sets the default gateway. You can chance that but as stated before you can not force a renew, so the client will get the new info only on a refresh.
If you only care about your laptop.... And it is a Linux or Unix then maybe consider to configure ospf and disable DHCP option 3 so you can get a default route via ospf. I assume your laptop is connected with a cable and you have both the cable connection and wifi simultaneously....
Another option could be: if your mobile plan allows multiple sim cards you could get a second one and a 3g/4g modem, connect it to your router and use mwan3 to failover.
I think my laptop (MacOS) will automatically incorporate routes received through common protocols, but I'm not sure how to get my OpenWRT gateway to advertise/announce it's routes.
I don't see much dynamic routing info at https://openwrt.org/docs/guide-user/network/routing/start
I did find https://openwrt.org/docs/guide-user/services/babeld
For dynamic routing protocols on OpenWrt look into frrouting. This thread sparked interest so I searched a bit. Lots of routing protocols supported via frr: opkg list |grep ^frr
A quick search of OpenWrt docs didn't yield much but there may be useful info at https://frrouting.org/
Maybe you will find a common solution for your router and Mac if your router has the space to install something appropriate.
Alternatively, you could look at finding or developing a script that checks connectivity locally on your Mac and sets the default route to the path that is "up" or the preferred path if both are up. The script could sleep a while and repeat in a loop or get run as a cron job every minute etc.
P.S. - I have no experience with this stuff and only pass on info from searches I just did.