Template sans "channels"

Clemens Schrimpe clemens.schrimpe at gmail.com
Thu Jan 9 15:20:23 CET 2020


Ahoj (again) :-)

While in the process of cleaning up "ancient" configs (basically rewriting them from scratch) I came across an odd discovery:

A template definition (for a kernel protocol) demands the specification of one (and only one) channel - which, in my case, defeats the whole purpose of having a kernel template in the first place.

I attempted to have a template with all the "standard behaviour" I wanted (persist, metric, table #, ...) for both IPv6 and legacy-IPv4 kernel tables and then tried to apply it like so:

template kernel KERNEL {
        persist;
        learn;
        metric 20;

        kernel table 10;
}

protocol kernel KERNEL6 from KERNEL {
	ipv6;
}

protocol kernel KERNEL4 from KERNEL {
	ipv4;
}

... because I thought the templating mechanism was "just" some syntactic sugar, similar to an "include" statement?!

As the kernel template demands a (single) channel statement, which could then, upon invocation, not be "negated" again, i.e., by a 

	no ipv4;

statement I can only have two templates - one pre-destined for IPv6 and another for IPv4.

What is the intention behind this? I do understand, that -in the end- the actual protocol defined through a template must have one (and only one in the case of a "kernel" protocol) channel definition and in my example this requirement would be fulfilled.

Thoughts? Hints?

Thanks again -

	Clemens



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20200109/4adaa924/attachment.htm>


More information about the Bird-users mailing list