Fwd: Filter OSPF to kernel routes
Alexander Zubkov
green at qrator.net
Mon Aug 8 09:31:15 CEST 2022
Hi,
Probably "net.len = 0" should be enough.
On Mon, Aug 8, 2022 at 9:14 AM Mikhail Mayorov <mm at tagan.ru> wrote:
> Hi!
>
> I am using a similar function for both IPv4/IPv6.
>
> function
> isdefault()
>
> {
>
> if net.type = NET_IP4 && net = 0.0.0.0/0 then return
> true;
>
> if net.type = NET_IP6 && net = ::/0 then return
> true;
>
> return
> false;
>
> }
>
> Maybe I can reduce the number of comparisons?
> If I compare ::/0 with an IPv4 address, what will be the result?
> On 07.08.2022 19:21, Ondrej Zajicek wrote:
>
> On Sun, Aug 07, 2022 at 04:24:22PM +0200, Marcus Büttemeyer wrote:
>
> 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"?
>
> 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'
>
>
>
> 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?
>
> 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').
>
>
> --
>
> Regards,
> Mikhail V. Majorov
> Megalink, CEO
> B.Bulvarnaya 11, Taganrog, Russia, 347913
> tel work: +7 8634 431431 (ext 101)
> tel mobile: +7 905 4309006
>
> [image: pg19.ru]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20220808/aafcdc19/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo.png
Type: image/png
Size: 11613 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20220808/aafcdc19/attachment.png>
More information about the Bird-users
mailing list