BIRD export reject not working
Hello guys, I got strange problem with BGP i share data to Collector but i put to reject some bgp path.... This is how look configuration of BGP session of Collector: protocol bgp Collector { description "Collector"; local as MY-ASN; source address IPv61; neighbor IPV62 as SOMEONE-ASN; multihop; import none; export filter { if bgp_path.first = 64515 then reject; if bgp_path = 64515 then reject; if bgp_path.last = 64515 then reject; include "export.conf"; }; } But: root@pl-bgp:~# birdc6 show route export Collector all 2a0b:e206::/32 BIRD 1.6.3 ready. 2a0b:e206::/32 via 2a06:1287:330e:16::2 on bgp-fr [France 2017-09-18] * (100) [AS21430i] Type: BGP unicast univ BGP.origin: IGP BGP.as_path: MY-ASN 64515 20473 1299 21430 BGP.next_hop: 2a07:XXXX.XXXX.XXXX BGP.local_pref: 100 BGP.community: (64515,44) Like You see in BGP path there is 64515. How i export this to Collector if i put reject on export? What is wrong? I use BIRD 1.6.3. Best Regards Marek Krolikowski
Hi, IIRC, bird added your local ASN before export filter, so 64515 is neither first nor last in ASN Path, and it isn't exactly only 64515 in the path. I suggest to use something like: if bgp_path ~ [= * 64515 * =] then reject; This should reject any bgp_path contains AS 64515. HTH, tim On Tue, Sep 19, 2017 at 10:50:47AM +0200, Marek Królikowski wrote:
Hello guys, I got strange problem with BGP i share data to Collector but i put to reject some bgp path....
This is how look configuration of BGP session of Collector:
protocol bgp Collector { description "Collector"; local as MY-ASN; source address IPv61; neighbor IPV62 as SOMEONE-ASN; multihop; import none; export filter { if bgp_path.first = 64515 then reject; if bgp_path = 64515 then reject; if bgp_path.last = 64515 then reject; include "export.conf"; }; }
But: root@pl-bgp:~# birdc6 show route export Collector all 2a0b:e206::/32 BIRD 1.6.3 ready. 2a0b:e206::/32 via 2a06:1287:330e:16::2 on bgp-fr [France 2017-09-18] * (100) [AS21430i] Type: BGP unicast univ BGP.origin: IGP BGP.as_path: MY-ASN 64515 20473 1299 21430 BGP.next_hop: 2a07:XXXX.XXXX.XXXX BGP.local_pref: 100 BGP.community: (64515,44)
Like You see in BGP path there is 64515. How i export this to Collector if i put reject on export? What is wrong?
I use BIRD 1.6.3.
Best Regards Marek Krolikowski
-- Tim Weippert http://weiti.org - weiti@weiti.org GPG Fingerprint - E704 7303 6FF0 8393 ADB1 398E 67F2 94AE 5995 7DD8
On Tue, Sep 19, 2017 at 11:27:58AM +0200, Tim Weippert wrote:
Hi,
IIRC, bird added your local ASN before export filter, so 64515 is neither first nor last in ASN Path, and it isn't exactly only 64515 in the path.
Hi, you are right, but note that 'if bgp_path = 64515 then reject;' does not check whether it is exactly only 64515 in the path, it is just type error (and it is probably reported, but to logs, not to birdc shell). But i wonder why it is shown in such case, as any error during filter execution is generally handled as reject.
I suggest to use something like:
if bgp_path ~ [= * 64515 * =] then reject;
This should work, but simpler way is this: if 64515 ~ bgp_path then reject;
This should reject any bgp_path contains AS 64515.
-- 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."
-----Oryginalna wiadomość----- From: Ondrej Zajicek
I suggest to use something like:
if bgp_path ~ [= * 64515 * =] then reject; This should work, but simpler way is this: if 64515 ~ bgp_path then reject;
Ok question why if bgp_path = 64515 then reject; not working and don`t give errors if this is wrong.... Maybe this is a BUG? I just check and: if bgp_path ~ [= * 64515 * =] then reject; Working properly.... Best Regards Thanks for help!
Hi. You check 64515 to be firs, last or the only (which is redundant check here) AS in the path. And in your example: MY-ASN 64515 20473 1299 21430 - it is not the first or last. On Tue, Sep 19, 2017 at 10:50 AM, Marek Królikowski <admin@wset.edu.pl> wrote:
Hello guys, I got strange problem with BGP i share data to Collector but i put to reject some bgp path....
This is how look configuration of BGP session of Collector:
protocol bgp Collector { description "Collector"; local as MY-ASN; source address IPv61; neighbor IPV62 as SOMEONE-ASN; multihop; import none; export filter { if bgp_path.first = 64515 then reject; if bgp_path = 64515 then reject; if bgp_path.last = 64515 then reject; include "export.conf"; }; }
But: root@pl-bgp:~# birdc6 show route export Collector all 2a0b:e206::/32 BIRD 1.6.3 ready. 2a0b:e206::/32 via 2a06:1287:330e:16::2 on bgp-fr [France 2017-09-18] * (100) [AS21430i] Type: BGP unicast univ BGP.origin: IGP BGP.as_path: MY-ASN 64515 20473 1299 21430 BGP.next_hop: 2a07:XXXX.XXXX.XXXX BGP.local_pref: 100 BGP.community: (64515,44)
Like You see in BGP path there is 64515. How i export this to Collector if i put reject on export? What is wrong?
I use BIRD 1.6.3.
Best Regards Marek Krolikowski
participants (4)
-
Alexander Zubkov -
Marek Królikowski -
Ondrej Zajicek -
Tim Weippert