<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi!</p>
<p>I try make route reflector using bird for 20 BGP routers in my
network. 4 of them have many RIB and have fullview with over
millions routes. But over needs only local ASN's routes and
default.</p>
<p>I was try configure dynamic peers . But I can't known context of
which the filter is executed. I need to identify the neighbor with
whom I have a session.</p>
<p>To do this, I was forced to abandon dynamic neighbors and create
a separate config for each neighbor. This is certainly not
difficult, but very inconvenient. Moreover, the filtering process
is also very important for marking routes by different
communities. I didn't find any mechanisms to do this with dynamic
neighbors. Probably this option is not very popular with the
community and it is rarely used. Or maybe I'm just being stupid.
:)<br>
</p>
<div class="moz-cite-prefix">10.10.2024 00:13, Alexander Zubkov
пишет:<br>
</div>
<blockquote type="cite"
cite="mid:CABr+u0bmpojkaHG_kCAF1-2_KQnmFdRRFyfCeehKcPwzcNmZ6Q@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>There is "from" attribute that should contain the IP
address of a remote router received via bgp protocol. But if
you want to know the router ID - I do not know about such
attribute.<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Oct 9, 2024 at
12:38 PM Mikhail Mayorov <<a href="mailto:mm@tagan.ru"
moz-do-not-send="true" class="moz-txt-link-freetext">mm@tagan.ru</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Hi</p>
<p>Thank you for explain. Of course you are right, I replace
string with int and got similar functionality. For me it
doesn't matter.<br>
</p>
<p>I already wrote about dynamic BGP protocols and a
import/export filter in which I need to understand with
whom I have a session for correct filtering. It would be
very useful to add to route attributes "routerid", "source
ip" or "BGP.hostname". This functionality is similar to
the "proto" route attribute, but if use bgp dynamic
protocols creating attribute "proto" is meaningless.<br>
</p>
<p>I find сustom attributes have to be first declared by
"attribute" global option. This suits me, but I can't find
ways to assign the required value.</p>
<p>Also, name of dynamic proto will be more filled with
meaning if use hostname or routerid.<br>
</p>
<div>08.10.2024 18:07, Ondrej Zajicek пишет:<br>
</div>
<blockquote type="cite">
<pre>On Tue, Oct 08, 2024 at 12:16:42PM +0300, Mikhail Mayorov wrote:
</pre>
<blockquote type="cite">
<pre>Hi!
I try use CASE and string variable and a have error.... I checked User's
guide 2.0 <a
href="https://bird.network.cz/?get_doc&f=bird.html&v=20"
target="_blank" moz-do-not-send="true"><https://bird.network.cz/?get_doc&f=bird.html&v=20></a>.... CASE use
operator ~. This operator applies to string variables. What am I doing
wrong?
</pre>
</blockquote>
<pre>Hi
Seems like a discrepancy between functionality and documentation.
The description of 'case' [1] says:
The expression after case can be of any type which can be on the left
side of the ~ operator and anything that could be a member of a set is
allowed
But in fact, only the second part is true, only values that could be
members of sets are allowed (with the exception of prefixes, as prefix
sets are implemented in a different way). According to [2], that are:
int | pair | quad | ip | prefix | ec | lc | enum
We probably should fix 'case' for prefixes. Looking at it now, there is
also vpnrd, which is allowed in set, but undocumented, and not in switch.
In principle, we could extend sets / case to contain strings / bytesrings,
but i do not really see use case.
[1] <a
href="https://bird.network.cz/?get_doc&v=20&f=bird-5.html#control-structures"
target="_blank" moz-do-not-send="true">https://bird.network.cz/?get_doc&v=20&f=bird-5.html#control-structures</a>
[2] <a
href="https://bird.network.cz/?get_doc&v=20&f=bird-5.html#type-set"
target="_blank" moz-do-not-send="true">https://bird.network.cz/?get_doc&v=20&f=bird-5.html#type-set</a>
</pre>
<blockquote type="cite">
<pre>[root@wine etc]# cat 123.conf && bird -c ./123.conf -p
function teststring(string myvar) -> bool
{
case myvar {
"text A" : print "A"; return true;
"text B" : print "B"; return true;
"text C" : print "C"; return true;
else : print "unknown"; return false;
}
}
bird: ./123.conf:4:12 syntax error, unexpected TEXT
--
Regards,
Mikhail Mayorov
</pre>
</blockquote>
</blockquote>
<div>-- <br>
<div>
<pre>Regards,
Mikhail Mayorov
PG19, founder and inspirer
B.Bulvarnaya 11, Taganrog, Russia, 347913
tel work: +7 8634 431431 (ext 101)
tel mobile: +7 905 4309006
</pre>
<img src="cid:part1.CKqQ0Bys.lFckKMzo@tagan.ru"
alt="pg19.ru" width="152" height="67" class=""> </div>
</div>
</div>
</blockquote>
</div>
</blockquote>
<div class="moz-signature">-- <br>
<div class="moz-signature">
<pre>Regards,
Mikhail Mayorov
PG19, founder and inspirer
B.Bulvarnaya 11, Taganrog, Russia, 347913
tel work: +7 8634 431431 (ext 101)
tel mobile: +7 905 4309006
</pre>
<img moz-do-not-send="false"
src="cid:part1.CKqQ0Bys.lFckKMzo@tagan.ru" alt="pg19.ru"
width="152" height="67">
</div>
</div>
</body>
</html>