Re: Import directly connected routes
Hello again, Is there any way to declare a list of interfaces in a string set or something ? The goal would be to use it in direct protocol, and in pipe protocol (import where ifname ~ list_if1) Regards, On 08/05/17 03:47 PM, Ondrej Zajicek wrote:
On Mon, May 08, 2017 at 03:45:17PM -0400, Damien Clabaut wrote:
Hello Ondrej,
Thank you for your answer.
I did not manage to do it with "device", but "direct" works: Yes, that was my mistake. 'direct' is the correct one,
-- Damien Clabaut R&D vRouter ovh.qc.ca
Anno domini 2017 Damien Clabaut scripsit: Hi,
Is there any way to declare a list of interfaces in a string set or something ?
The goal would be to use it in direct protocol, and in pipe protocol (import where ifname ~ list_if1)
How 'bout managing the list of devices within the direct protocol and in the pipe filtering on the protocol name? Like protocol direct "connected" { interface "eth0", "vlan42"; } import where proto = "connected" Best Max -- "Wer nicht mehr liebt und nicht mehr irrt, der lasse sich begraben." -- Johann Wolfgang von Goethe
I have several 'direct" instances which write in different routing table. I would like to have it manipulated by robots in the context of automated deployment, so it would be a lot easier to have lists in variables in a separate config file than isolated in similar lines in one config file. Maybe this can be done through the C API though ? On 08/05/17 05:23 PM, Maximilian Wilhelm wrote:
Anno domini 2017 Damien Clabaut scripsit:
Hi,
Is there any way to declare a list of interfaces in a string set or something ?
The goal would be to use it in direct protocol, and in pipe protocol (import where ifname ~ list_if1) How 'bout managing the list of devices within the direct protocol and in the pipe filtering on the protocol name?
Like
protocol direct "connected" { interface "eth0", "vlan42"; }
import where proto = "connected"
Best Max
-- Damien Clabaut R&D vRouter ovh.qc.ca
On Mon, May 08, 2017 at 04:43:32PM -0400, Damien Clabaut wrote:
Hello again,
Is there any way to declare a list of interfaces in a string set or something ?
No, string sets are not implemented. Although it is something that makes sense to add. You could define functions that match a set of string: function xxx(string s) { return s = "dev1" || s = "dev2" || s = "dev3"; } Then you could use such functions in filters of direct and pipe protocol. Instead of: protocol direct direct_numa0 { table numa0; interface "eth4.800", "eth4.801"; } You could use: protocol direct direct_numa0 { table numa0; import where xxx(ifname); } -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (3)
-
Damien Clabaut -
Maximilian Wilhelm -
Ondrej Zajicek