Bird pipe/filter change on "external" conditions
Hello, Is there some way to change bird's configuration on some external event? I would use it like this: There are 2 routers, active and passive. Active router exports default route for the rest of network. Passive router has exactly the same configuration, but filters out default route. When active/passive switch function, the new active somehow removes default route filter, the new passive adds default route filter. Another usage would be to change interface cost in OSPF at run-time and thus redirecting traffic from that particular interface. Currently I am doing it with rewritting bird's config file and reloading configuration. Is there some better way? Like setting some variable, which causes changes some filter conditions? Thanks ico
Hello, I do almost the same, but do not rewrite the config. I have an include in the place I want to change to a symlinked file. I change the symlink and reload the config. So I have my configs static, I change only symlinks. On Fri, Feb 19, 2021 at 2:44 AM ico <ico@petrzalka.net> wrote:
Hello,
Is there some way to change bird's configuration on some external event? I would use it like this:
There are 2 routers, active and passive. Active router exports default route for the rest of network. Passive router has exactly the same configuration, but filters out default route. When active/passive switch function, the new active somehow removes default route filter, the new passive adds default route filter.
Another usage would be to change interface cost in OSPF at run-time and thus redirecting traffic from that particular interface.
Currently I am doing it with rewritting bird's config file and reloading configuration. Is there some better way? Like setting some variable, which causes changes some filter conditions?
Thanks
ico
Hello, Well I was hoping for something like import filter { if env.somevariable = 0 then reject; accept; }; And then somehow set somevariable via birdc.... But using symlinks sounds better than overwriting config files. Thanks ico On 21. 2. 2021 11:43, Alexander Zubkov wrote:
Hello,
I do almost the same, but do not rewrite the config. I have an include in the place I want to change to a symlinked file. I change the symlink and reload the config. So I have my configs static, I change only symlinks.
On Fri, Feb 19, 2021 at 2:44 AM ico <ico@petrzalka.net> wrote:
Hello,
Is there some way to change bird's configuration on some external event? I would use it like this:
There are 2 routers, active and passive. Active router exports default route for the rest of network. Passive router has exactly the same configuration, but filters out default route. When active/passive switch function, the new active somehow removes default route filter, the new passive adds default route filter.
Another usage would be to change interface cost in OSPF at run-time and thus redirecting traffic from that particular interface.
Currently I am doing it with rewritting bird's config file and reloading configuration. Is there some better way? Like setting some variable, which causes changes some filter conditions?
Thanks
ico
On Mon, 22 Feb 2021 at 19:34, ico wrote:
But using symlinks sounds better than overwriting config files.
Depends partly on your preference, too. Using one large config file. And updating a symlink to do dst=bird_202002231200.conf src=bird.conf rm $src ln -sr $src $dst Is one way. Another would be to split it out into smaller chunks. With the main bird.conf file rarely changing. And mostly everything in the included files is what changes. E.g. each BGP peer is configured in a sub-dir, and one-file-per-BGP-peer. ./peers/$peer.conf Your approach is your own to decide! When changing the bird.conf files. You have to force a reload first regardless. Before BIRD daemon re-reads the conf file from the disk. (+ preferable running a bird -c configure check ["config file"] first [0], to verify the conf file to be reloaded is valid) [0]: https://bird.network.cz/?get_doc&v=20&f=bird-4.html -- Chriztoffer
participants (3)
-
Alexander Zubkov -
Chriztoffer Hansen -
ico