AW: Propagate default route when BGP session is up

Rohrmann Sascha Rohrmann at citkomm.de
Tue Aug 22 13:54:25 CEST 2017


Hi Robert,

some time ago we had the same question which brought us to the following solution:
we wrote a simple shell script which checks if the bgp session is up.
If so, the router runs bird and propagates the default route.
If the connection is down the router disables bgp and the other router becomes the master (which hopefully still has the active and correct bgp session).

Greeting Sascha

> -----Ursprüngliche Nachricht-----
> Von: Bird-users [mailto:bird-users-bounces at network.cz] Im Auftrag von
> Robert Sander
> Gesendet: Freitag, 18. August 2017 16:05
> An: Bird Users
> Betreff: Propagate default route when BGP session is up
> 
> Hi,
> 
> how do I propagate a default route into OSPF when a specific BGP session is
> up and not propagate it when it is down?
> 
> Currently I have these config snippets:
> 
> protocol static static_default {
>   preference 10;
>   route 0.0.0.0/0 unreachable;
> }
> 
> function export_ospf() {
>   if source = RTS_BGP then {
>     return false;
>   }
>   if proto = "static_bgp" then {
>     return false;
>   }
>   return true;
> }
> 
> protocol ospf {
>   rfc1583compat on;
>   import all;
>   export filter {
>     if export_ospf() then accept;
>     reject;
>   };
>   area 0 {
>     interface "ospf" {
>       cost 10;
>       hello 10;
>       retransmit 5;
>       dead 45;
>     };
>   };
> }
> 
> protocol bgp ispa1 {
>   description "ISP A1";
>   import all;
>   export filter {
>     if proto = "static_bgp" then accept;
>     reject;
>   };
>   local 1.2.3.6 as 1;
>   neighbor 1.2.3.5 as 2;
>   password "xyz";
> }
> 
> I can manually "birdc disable static_default" to not propagate the default
> route but how can this be automated when the BGP session to
> ispa1 is down?
> 
> Regards
> --
> Robert Sander
> Heinlein Support GmbH
> Schwedter Str. 8/9b, 10119 Berlin
> 
> http://www.heinlein-support.de
> 
> Tel: 030 / 405051-43
> Fax: 030 / 405051-19
> 
> Zwangsangaben lt. §35a GmbHG:
> HRB 93818 B / Amtsgericht Berlin-Charlottenburg,
> Geschäftsführer: Peer Heinlein -- Sitz: Berlin




More information about the Bird-users mailing list