Closed CloudieLLC closed 1 year ago
+1, I agree this is a useful feature. Pathvector already have template replacements (https://pathvector.io/docs/snippets) so will probably stick with the "<pathvector.$OPTION>" syntax.
I'm taking another look at this, and on second thought think it would be better left to a higher level component to manage the yaml config. Adding nonstandard meaning to the config is risky, and doing so would make the config more visually confusing and require validation that will add undue complexity to the config parser.
The reason template replacements are already present before rendering to BIRD is that there isn't another way to inject data between pathvector and BIRD, whereas the pathvector config file can be easily modified before running pathvector.
I'm considering this out of scope, but the same behavior should be doable with a templating engine like jinja2 and a quick python script. Happy to review a PR adding an example to the docs site!
Bumping this... This night (UTC+7), i was very bored, and i was thinking to make an control community things, and the barebone are like this
if (
(LocalASN,NeighborASN,1) ~ bgp_large_community
)
then {
bgp_path.prepend(LocalASN);
}
if (
(LocalASN,NeighborASN,2) ~ bgp_large_community
)
then {
bgp_path.prepend(LocalASN);
bgp_path.prepend(LocalASN);
}
if (
(LocalASN,NeighborASN,3) ~ bgp_large_community
)
then {
bgp_path.prepend(LocalASN);
bgp_path.prepend(LocalASN);
bgp_path.prepend(LocalASN);
}
if (
(LocalASN,NeighborASN,9) ~ bgp_large_community
)
then {
reject;
}
I was thinking the same idea, i think it's nice to have LocalASN variable and the NeighborASN variable :)
Maybe listing the snippets (variables) too? :D
This many not be applicable to most users, but say.. I've got a large community set for a each downstream user, for future usage etc. to avoid situations for human error, the ability to utilize a variable for
asn:
elsewhere for example.to
This could be used for a number of things, later down the track etc. and just something to think about since i was sitting there rewriting my config file.