Importing/exporting only static routes from the kernel
Hi, I'm wondering if there is a way with bird to only import static routes from the kernel routing table. Routes are currently being managed directly in the linux routing table via keepalived, however, I want to announce them out via BGP. I have tried just; kernel { import all; export all; } and this picks up the routes I want, however, it also imports a load of unreachable routes that I don't want to advertise. [root@infra-fw1a ~]# birdc6 show route protocol kernel1 BIRD 1.3.9 ready. ::/96 unreachable [kernel1 11:55] * (10) 2002:a00::/24 unreachable [kernel1 11:55] * (10) 3ffe:ffff::/32 unreachable [kernel1 11:55] * (10) 2002:7f00::/24 unreachable [kernel1 11:55] * (10) 2002:a9fe::/32 unreachable [kernel1 11:55] * (10) 2002:ac10::/28 unreachable [kernel1 11:55] * (10) 2a03:b200:0:2::/64 via 2a03:b200:1:2::2 on eth1.227 [kernel1 11:55] * (10) 2002:e000::/19 unreachable [kernel1 11:55] * (10) 2002:c0a8::/32 unreachable [kernel1 11:55] * (10) ::ffff:0.0.0.0/96 unreachable [kernel1 11:55] * (10) [root@infra-fw1a ~]# I know I can probably filter these, but that seems less ideal. Is there a way of just importing the reachable routes? Thanks, Rob
On Wed, May 29, 2013 at 12:27:26PM +0100, Rob Greenwood wrote:
Hi,
I'm wondering if there is a way with bird to only import static routes from the kernel routing table. Routes are currently being managed directly in the linux routing table via keepalived, however, I want to announce them out via BGP.
You can filter by the source attribute of a route (for static routes it must be RTS_STATIC).
Hi Oleg, Could you give an example? I tried doing export where source = RTS_STATIC; but that didn't seem to work -Rob On Wednesday, 29 May 2013, Oleg wrote:
On Wed, May 29, 2013 at 12:27:26PM +0100, Rob Greenwood wrote:
Hi,
I'm wondering if there is a way with bird to only import static routes from the kernel routing table. Routes are currently being managed directly in the linux routing table via keepalived, however, I want to announce them out via BGP.
You can filter by the source attribute of a route (for static routes it must be RTS_STATIC).
On Wed, May 29, 2013 at 01:16:13PM +0100, Rob Greenwood wrote:
Hi Oleg,
Could you give an example? I tried doing export where source = RTS_STATIC; but that didn't seem to work
This is a simple import filter: protocol kernel { ... import where source = RTS_STATIC; export all; } If unreachable routes pass this filter too, you can filter off its by the next expression: import where dest != RTD_UNREACHABLE;
Thanks! The unreachable filter worked great. -Rob On Wednesday, 29 May 2013, Oleg wrote:
On Wed, May 29, 2013 at 01:16:13PM +0100, Rob Greenwood wrote:
Hi Oleg,
Could you give an example? I tried doing export where source = RTS_STATIC; but that didn't seem to work
This is a simple import filter:
protocol kernel { ... import where source = RTS_STATIC; export all; }
If unreachable routes pass this filter too, you can filter off its by the next expression:
import where dest != RTD_UNREACHABLE;
participants (2)
-
Oleg -
Rob Greenwood