Fwd: Filter OSPF to kernel routes

Ondrej Zajicek santiago at crfreenet.org
Sun Aug 7 18:21:14 CEST 2022


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').

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at 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."



More information about the Bird-users mailing list