
Here's a simplified version of my network. My problem is that OPNsense keeps advertising the 0.0.0.0/0 kernel route even when the gateway health check marks the gateway as offline. In the BGP peering settings, "advertise default route" is unchecked. I redistribute the 0.0.0.0/0 kernel route to BGP, and I believe the main issue is that OPNsense retains that kernel route even when the gateway is down or offline. This causes the second router to continue routing internet traffic to OPNsense, even when the fiber connection is down.
How I could set OPNsense to advertise 0.0.0.0/0 route only when the gateway is up?