Inject default route via OSPF, but only to specific OSPF peer and contingent on BGP session established

Lukas Haase lukashaase at gmx.at
Wed Jan 10 00:28:11 CET 2024


Hi,

I have two "border gateways"; each establishes a BGP session to the outside world. An internal router connects to each of the border gateways and uses OSPF to exchange routes. (Note, other OSPF links may exist as well).

Both border gateways act as default gateways for the internal router. In order to create redundancy, each border gateway should send the default route via OSPF to the internal router. However, the default route should not be sent to any other device (otherwise it would mess up everything, incl tunnels).

Additionally, injecting the default route should be contingent on having the BGP session established successfully (only then I can assume the route to the internet is good).

This is my current bird.conf (most relevant parts):

protocol bgp vultr
{
  local as xxx;
  source address xxx;
  import none;
  export filter
  {
    if(proto = "static_bgp") then
    {
      accept;
    };
  };
  graceful restart on;
  multihop 2;
  neighbor xx yy;
  password "xxxx";
};

protocol static static_bgp
{
  route 192.0.2.0/24 via xxxx;
};

protocol ospf internal
{
  import all;
  export none;
  area 0.0.0.0 {
    interface "wg-introuter" {
      cost 100;hello 10;retransmit 5;wait 5;dead 40;
      type broadcast;
      authentication cryptographic;
      password "xxx" {
        id 1;
      };
    };
  };
};


Thanks,
Luke


More information about the Bird-users mailing list