Hi, I need to print the bgp_large_community for debugging purposes but all I get is the output "(lclist )". Are these list not printable? Regards -- Robert Sander Heinlein Support GmbH Schwedter Str. 8/9b, 10119 Berlin http://www.heinlein-support.de Tel: 030 / 405051-43 Fax: 030 / 405051-19 Zwangsangaben lt. §35a GmbHG: HRB 93818 B / Amtsgericht Berlin-Charlottenburg, Geschäftsführer: Peer Heinlein -- Sitz: Berlin
On Tue, Jan 24, 2017 at 02:02:39PM +0100, Robert Sander wrote:
Hi,
I need to print the bgp_large_community for debugging purposes but all I get is the output "(lclist )".
Are these list not printable?
Hi Works for me: filter/test.conf : ... ll = --- empty ---; ll = add(ll, (ten, 20, 30)); ll = add(ll, (1000, 2000, 3000)); ll = add(ll, mktrip(100000)); print "LC list (10, 20, 30) (1000, 2000, 3000) (100000, 200000, 300000):"; print ll; ... ./bird -p -c filter/test.conf : ... bird: LC list (10, 20, 30) (1000, 2000, 3000) (100000, 200000, 300000): bird: (lclist (10, 20, 30) (1000, 2000, 3000) (100000, 200000, 300000)) ... How are you using it? -- 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."
On 24.01.2017 14:19, Ondrej Zajicek wrote:
On Tue, Jan 24, 2017 at 02:02:39PM +0100, Robert Sander wrote:
Hi,
I need to print the bgp_large_community for debugging purposes but all I get is the output "(lclist )".
How are you using it?
In a function in a filter like this: print bgp_community; print bgp_large_community; Self defined variables like "lc set test" can be printed with print test; without issues. Wait a minute. If I only get "(lclist )" does that mean the community list is empty? When I have a look at the route from the CLI I get this: BIRD 1.6.3 ready. 80.241.56.0/21 via 10.25.17.251 on br0.17 [ospf1 23:01:29] * E2 (1000/1000/10000) [80.241.60.13] Type: OSPF-E2 unicast univ OSPF.metric1: 1000 OSPF.metric2: 10000 OSPF.tag: 0x00000000 OSPF.router_id: 80.241.60.13 unreachable [static_bgp 23:15:16] (10) Type: static unicast univ BGP.large_community: (199118, 1, 0) The route is in a static protocol on this router and on 80.241.60.13, which propagates this via OSPF. Regards -- Robert Sander Heinlein Support GmbH Schwedter Str. 8/9b, 10119 Berlin http://www.heinlein-support.de Tel: 030 / 405051-43 Fax: 030 / 405051-19 Zwangsangaben lt. §35a GmbHG: HRB 93818 B / Amtsgericht Berlin-Charlottenburg, Geschäftsführer: Peer Heinlein -- Sitz: Berlin
On Tue, Jan 24, 2017 at 02:27:11PM +0100, Robert Sander wrote:
In a function in a filter like this:
print bgp_community; print bgp_large_community;
Self defined variables like "lc set test" can be printed with
print test;
without issues.
Wait a minute. If I only get "(lclist )" does that mean the community list is empty?
That should be true. Unfortunately filters do not distinguish between no bgp_community attribute and an empty bgp_community attribute.
When I have a look at the route from the CLI I get this:
BIRD 1.6.3 ready. 80.241.56.0/21 via 10.25.17.251 on br0.17 [ospf1 23:01:29] * E2 (1000/1000/10000) [80.241.60.13] Type: OSPF-E2 unicast univ OSPF.metric1: 1000 OSPF.metric2: 10000 OSPF.tag: 0x00000000 OSPF.router_id: 80.241.60.13 unreachable [static_bgp 23:15:16] (10) Type: static unicast univ BGP.large_community: (199118, 1, 0)
The route is in a static protocol on this router and on 80.241.60.13, which propagates this via OSPF.
Well i see two routes here, one from ospf1 and one from static_bgp. Don't you apply the filter just for the first one? That would be true in say export filter. You could add 'print proto;' to see the protocol source of the route. -- 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."
On 24.01.2017 15:13, Ondrej Zajicek wrote:
Well i see two routes here, one from ospf1 and one from static_bgp. Don't you apply the filter just for the first one? That would be true in say export filter. You could add 'print proto;' to see the protocol source of the route.
Bummer. How do I apply a filter for a prefix from multiple protocols? Regards -- Robert Sander Heinlein Support GmbH Schwedter Str. 8/9b, 10119 Berlin http://www.heinlein-support.de Tel: 030 / 405051-43 Fax: 030 / 405051-19 Zwangsangaben lt. §35a GmbHG: HRB 93818 B / Amtsgericht Berlin-Charlottenburg, Geschäftsführer: Peer Heinlein -- Sitz: Berlin
On Tue, Jan 24, 2017 at 03:31:00PM +0100, Robert Sander wrote:
On 24.01.2017 15:13, Ondrej Zajicek wrote:
Well i see two routes here, one from ospf1 and one from static_bgp. Don't you apply the filter just for the first one? That would be true in say export filter. You could add 'print proto;' to see the protocol source of the route.
Bummer. How do I apply a filter for a prefix from multiple protocols?
Not sure what you want. Do you mean filter in route export? In BGP, you could use 'add path' capability for exporting all matching routes or 'secondary' option for exporting the first route that is accepted by filter. -- 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."
Am 25.01.2017 um 14:35 schrieb Ondrej Zajicek:
On Tue, Jan 24, 2017 at 03:31:00PM +0100, Robert Sander wrote:
Bummer. How do I apply a filter for a prefix from multiple protocols?
Not sure what you want. Do you mean filter in route export?
Yes.
In BGP, you could use 'add path' capability for exporting all matching routes or 'secondary' option for exporting the first route that is accepted by filter.
It looks like the secondary option is the one I want to use. But it needs a sorted table. How do I make the default table sorted? Or do I have to make all the protocols use a new table? Regards -- Robert Sander Heinlein Support GmbH Schwedter Str. 8/9b, 10119 Berlin http://www.heinlein-support.de Tel: 030 / 405051-43 Fax: 030 / 405051-19 Zwangsangaben lt. §35a GmbHG: HRB 93818 B / Amtsgericht Berlin-Charlottenburg, Geschäftsführer: Peer Heinlein -- Sitz: Berlin
Am 27.01.2017 um 08:48 schrieb Robert Sander:
Am 25.01.2017 um 14:35 schrieb Ondrej Zajicek:
On Tue, Jan 24, 2017 at 03:31:00PM +0100, Robert Sander wrote:
Bummer. How do I apply a filter for a prefix from multiple protocols?
Not sure what you want. Do you mean filter in route export?
Yes.
In BGP, you could use 'add path' capability for exporting all matching routes or 'secondary' option for exporting the first route that is accepted by filter.
It looks like the secondary option is the one I want to use. But it needs a sorted table. How do I make the default table sorted? Or do I have to make all the protocols use a new table?
I found another solution, a table that is connected to all BGP protocols and gets only static routes from the default table: table tbgp; protocol pipe { peer table tbgp; export filter { if source = RTS_STATIC then accept; reject; }; import all; } With this the BGP protocols only see one route and the export filter is happy. Regards -- Robert Sander Heinlein Support GmbH Schwedter Str. 8/9b, 10119 Berlin http://www.heinlein-support.de Tel: 030 / 405051-43 Fax: 030 / 405051-19 Zwangsangaben lt. §35a GmbHG: HRB 93818 B / Amtsgericht Berlin-Charlottenburg, Geschäftsführer: Peer Heinlein -- Sitz: Berlin
participants (2)
-
Ondrej Zajicek -
Robert Sander