bird 2.0: show only IPv4 or IPv6 routes from birdc

Ondrej Zajicek santiago at crfreenet.org
Mon Apr 6 22:55:19 CEST 2020


On Mon, Apr 06, 2020 at 01:39:45PM -0700, Craig Leres wrote:
> I also found:
> 
>     show route table master4
>     show route table master6
> 
> I'd rather not depend on the names of default routing tables. I suppose I
> could explicitly import the kernel routes into v4 and v6 tables but routing
> works without this extra complexity.

Hi

I think this is the best way. IPv4 and IPv6 routes are in separate
tables, so just specify that table.

You can use filter expression for route type, but this is more efficient,
as it will only process routes from given table, while filter expression
would process routes from both tables and then eliminate ones that have
different net.type


> One experiment I tried was:
> 
>     show route filter { print  "net.type is ", net.type; }
> 
> which logs 1 or 2 for IPv4 or IPv6:
> 
>     bird: net.type is (enum 36)1
>     bird: net.type is (enum 36)2

This is just missing code for proper printing of enums, it should show NET_IP4, NET_IP6.

> but the obvious commands do not print any routes:
> 
>     show route where net.type = 1
>     show route where net.type = 2

Try:

     show route where net.type = NET_IP4
     show route where net.type = NET_IP6


See https://bird.network.cz/?get_doc&v=20&f=bird-5.html#type-prefix

-- 
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