--On 17 August 2011 21:54:57 +0200 Ondrej Zajicek <santiago@crfreenet.org> wrote:
On Wed, Aug 17, 2011 at 07:59:39PM +0100, Alex Bligh wrote:
Is it possible either to control what routes the kernel protocol learns from the kernel using "learn" by what /kernel/ protocol they are (meaning the "protocol xxxx" field to the "ip route add" command on linux),
This is not possible - although the value of (kernel) protocol field is learned, it is not accessible to filters. It will be trivial to add this feature. But i wonder if there are any sensible use cases. Perhaps an import of routes from other routing daemons through kernel table?
Perhaps an explanation of the use case would be useful. I have a separate program (not a routing daemon, but I suppose similar) which is busy creating, numbering and deleting interfaces and adding routes to them. I need to learn both device routes (where the interface is numbered) and static routes pointing out the device (where the interface is not). These get distributed by bird into a routing protocol and sent elsewhere. My concern is to ensure I am not picking up (and thus distributing) any bogus routes other than those created & destroyed by the other program. Using the device protocol, I can mask out all the interfaces bar these autogenerated ones because I give them a name with a constant prefix. However, that's not posssible with routes; the only way to tag them (short of using a different kernel table, which is a overkill and also conflicts with some other stuff) is by routing protocol number (in the linux kernel sense). I don't really need this to be available to a filter, but it would be useful if "learn" could take a parameter which was (say) a list of (linux kernel) routing protocols. I suspect other OS's have similar things. -- Alex Bligh