Re: How do I configure BIRD to support multiple Linux kernel routing tables?

2018-03-07 Thread Ondrej Zajicek
On Sun, Feb 25, 2018 at 11:51:26AM -0700, Grant Taylor wrote:
> I think the key that I was missing was the "table deftab;" outside of
> "protocol kernel".
> 
> I also needed to remove the "main" and "default" from the "protocol kernel"
> lines.
> 
> And the apparent table name limitation got me.  "Default" is one letter too
> long."  :-/  (Table name length is probably documented somewhere I've not
> read yet.)

The problem is not that 'default' is too long, but that it is a keyword,
so it cannot be used as a table name.


> > 2) Trying to use BIRD keywords as protocol/table names would lead to
> > hard to understand 'syntax error' errors during configuration
> > processing.
> 
> That makes sense.  I just need to be smart enough to recognize when that
> happens.

To be fair, BIRD behavior when such issue happens is confusing and should
be better.

-- 
Elen sila lumenn' omentielvo

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


Re: How do I configure BIRD to support multiple Linux kernel routing tables?

2018-02-25 Thread Grant Taylor

On 02/25/2018 06:01 AM, Ondrej Zajicek wrote:

Hello


Hi,


protocol kernel {
learn;
export all;
import all;
# these are default values
# table master;
# kernel table 254;
}

table deftab;

protocol kernel {
learn;
export all;
import all;
table deftab;
kernel table 253;
}


I think the key that I was missing was the "table deftab;" outside of 
"protocol kernel".


I also needed to remove the "main" and "default" from the "protocol 
kernel" lines.


And the apparent table name limitation got me.  "Default" is one letter 
too long."  :-/  (Table name length is probably documented somewhere 
I've not read yet.)


This will sync kernel table 254 ('main') with default BIRD table 'master' 
and kernel table 253 ('default') with additional BIRD table 'deftab'.


Understood.

Optionally, you can use pipe protocol to distribute routes between 
these tables.


Do I need to use pipes to distribute routes between tables?

I ask this because I've updated the config (below) and now BIRD seems 
happier.  However I'm seeing evidence that the single / default route 
from the dfault table is being filtered (?).


bird: kernel2 > added [best] 0.0.0.0/0 via 8.44.144.1 on eth0
bird: kernel2 < rejected by protocol 0.0.0.0/0 via 8.44.144.1 on eth0

I think BIRD is seeing the single / default route and starts to use it, 
but then filters it, or at least that's what I think is happening.



There are two unexpected issues that may cause problems:

1) BIRD does not allow two Kernel protocol instances to be connected to 
the same BIRD table, you have to use two BIRD tables, like above.


Understood and duly noted.  -  I don't foresee this to be a problem for me.

2) Trying to use BIRD keywords as protocol/table names would lead to 
hard to understand 'syntax error' errors during configuration processing.


That makes sense.  I just need to be smart enough to recognize when that 
happens.


# cat /etc/bird.conf
protocol kernel {
learn;
export all;
import all;
persist no;
kernel table 254;
}

table dfault;

protocol kernel {
debug all;
learn;
export all;
import all;
persist no;
table dfault;
kernel table 253;
}

protocol device {
}

protocol direct {
interface "*";
}

protocol rip {
export all;
import all;
interface "wgc", "test1", "test2", "test3" {
version 2;
};
}



--
Grant. . . .
unix || die



smime.p7s
Description: S/MIME Cryptographic Signature


Re: How do I configure BIRD to support multiple Linux kernel routing tables?

2018-02-25 Thread Ondrej Zajicek
On Sat, Feb 24, 2018 at 09:03:28PM -0700, Grant Taylor wrote:
> Pre Script:  I'm a BIRD n00b
> 
> How do I configure BIRD to support multiple Linux kernel routing tables?
> 
> I have found and tried a few different things on the web, but none seem to
> be doing what I want.
> 
> I want to export routes from my "main" routing table (254) and an additional
> routing table "default" (253).

Hello

protocol kernel {
learn;
export all;
import all;
# these are default values
# table master;
# kernel table 254;
}

table deftab;

protocol kernel {
learn;
export all;
import all;
table deftab;
kernel table 253;
}


This will sync kernel table 254 ('main') with default BIRD table 'master'
and kernel table 253 ('default') with additional BIRD table 'deftab'.
Optionally, you can use pipe protocol to distribute routes between these
tables.

There are two unexpected issues that may cause problems:

1) BIRD does not allow two Kernel protocol instances to be connected to
the same BIRD table, you have to use two BIRD tables, like above.

2) Trying to use BIRD keywords as protocol/table names would lead to
hard to understand 'syntax error' errors during configuration processing.

-- 
Elen sila lumenn' omentielvo

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


signature.asc
Description: PGP signature


Re: How do I configure BIRD to support multiple Linux kernel routing tables?

2018-02-24 Thread Alexander Zubkov
Hello,

You need to use "kernel table" option in the kernel protocol to tell bird
which table it should look into.

On Sun, Feb 25, 2018 at 5:03 AM, Grant Taylor 
wrote:

> Pre Script:  I'm a BIRD n00b
>
> How do I configure BIRD to support multiple Linux kernel routing tables?
>
> I have found and tried a few different things on the web, but none seem to
> be doing what I want.
>
> I want to export routes from my "main" routing table (254) and an
> additional routing table "default" (253).
>
> Aside:  I have multiple ip rules to cascade across multiple routing tables
> (local, main, reject, bogons, …, and finally default) looking for a match.
> I do this so that I can have Linux's routing stack handle various filtering
> for me.
>
> BIRD is successfully exporting routes from the main (254) routing table.
> I'd like to also export route(s) from the default (253) routing table.
>
> # cat /etc/bird.conf
> protocol kernel main {
> learn;
> export all;
> import all;
> persist no;
> }
>
> protocol device {
> }
>
> protocol direct {
> interface "*";
> }
>
> protocol rip {
> export all;
> import all;
> interface "eth0", "eth1", "eth2", "eth3" {
> version 2;
> };
> }
>
> I have tried adding additional kernel protocols, including various
> incarnations of (kernel) table # entries and have had: syntax errors,
> references to required additional lines, and other unhappy things.
>
> So, will someone point me at a document that talks about how to work with
> multiple Linux routing tables?
>
> Thank you in advance.
>
>
>
> --
> Grant. . . .
> unix || die
>
>