<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi!</p>
<p>I am using a similar function for both IPv4/IPv6.<br>
</p>
<p>function
isdefault()
<br>
{
<br>
if net.type = NET_IP4 && net = 0.0.0.0/0 then return
true;
<br>
if net.type = NET_IP6 && net = ::/0 then return
true;
<br>
return
false;
<br>
}</p>
<p>Maybe I can reduce the number of comparisons?<br>
If I compare ::/0 with an IPv4 address, what will be the result?<br>
</p>
<div class="moz-cite-prefix">On 07.08.2022 19:21, Ondrej Zajicek
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:Yu%2FmejoikIsvIpem@finarfin.chrudimsko.czf">
<pre class="moz-quote-pre" wrap="">On Sun, Aug 07, 2022 at 04:24:22PM +0200, Marcus Büttemeyer wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">OK, the problem seems to have been the name of the filter. BIRD says
"syntax error, unexpected DEFAULT" so I renamed the filter to
"reject_default" and that works. What did BIRD not like about
"default-reject"?
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Hi
BIRD syntax allows only alphanumeric characters and underscore in names,
so default-reject is parsed as three tokens: "default", "-", "reject".
You can use apostrophes for defining names with other symbols:
'default-reject'
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Also, I have said filter configured as import and export filters in both
ospfv3 and kernel6 but the router in question still announces the default
route via OSPFv3. Can anybody tell me what filter I have to use in which
direction on which protocol so that a) the router ignores the incoming OSPF
default route and b) does not redistribute his default route via OSPF?
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
You should use both import (for (a)) and export (for (b)) filter for OSPF
protocol.
Also note the filter should be more like:
filter default-reject {
if net = ::/0 then reject; else accept;
}
There should be explicit accept (it should fail with error when ends
without reject or accept), and although "::/0 ~ net" should work, it
is kind of strange expression (it means if ::/0 is subnet or equal to
'net').
</pre>
</blockquote>
<div class="moz-signature">-- <br>
<div class="moz-signature">
<pre>Regards,
Mikhail V. Majorov
Megalink, CEO
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.6pY4Vt6S.YGVWho02@tagan.ru" alt="pg19.ru"
width="152" height="67">
</div>
</div>
</body>
</html>