Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Dynamically remove static routes when gateway down

    Scheduled Pinned Locked Moved Routing and Multi WAN
    2 Posts 2 Posters 1.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kalipinde
      last edited by

      Hi,

      I have a pFSense 2.2.6 firewall configured with static routes pointing to my WAN gateway e.g. 62.0.0.0/16. I also have OpenBGPD running to advertise these prefixes to a BGP router on my LAN side. The issue is that I would like to only advertise the prefixes ONLY IF they are reachable to avoid blackholing.

      Normally on a Cisco router I would do the following:
      1. Create an IP SLA track to monitor an IP address on the internet e.g. 8.8.8.8
      2. Configure static routes pointing to the WAN gateway but tracked against the IP SLA
      3. Redistribute the static routes into BGP

      This would mean that while the IP SLA was 'up', the static routes would be injected into the routing table which in turn would then get redistributed into BGP. If the IP SLA went 'down' the static routes would drop out of the routing table and hence out of BGP too.

      Is there a way to do this in pFSense?

      I can see that pFSense can monitor Gateway health and you can even set it with an 'Alternate Gateway IP' to monitor 8.8.8.8) so I could monitor but there doesn't seem to be any obvious way for it to remove the static routes when the gateway goes 'offline'.

      There might be a completely different way to do this so appreciate any thoughts on this!

      1 Reply Last reply Reply Quote 0
      • S
        steve.peace
        last edited by

        Did you ever find a solution to your problem?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.