RIB Component

The RIB component receives routes from each routing protocol and stores them in the RIB. For each network prefix the 'best' route is sent to the Linux Kernel / Dataplane for use when forwarding packets.

Enabling the RIB component

RIB component configuration is under the top level rib object in /etc/flockd/flockd.json

rib: {}

If the rib JSON object exists a RIB master thread will be started. If there is no entry, no RIB threads are started and IP routes will not be programmed to the kernel / dataplane.

Operational State

Overview

flock@flocknet:~$ flockc rib --af ipv4
{"route_count":2328}
flock@flocknet:~$

flock@flocknet:~$ flockc rib --af ipv6
{"route_count":5340}
flock@flocknet:~$

In all RIB commands IPv6 is the default address family

flock@flocknet:~$ flockc rib
{"route_count":5340}
flock@flocknet:~$

Longest Path Match (LPM) for destination

flock@flocknet:~$ flockc rib --af ipv4 -l 10.0.2.34
{"origin":"Ospfv2","next_hops":[{"intf_id":2,"ip_addr":"10.0.1.49"}]}
flock@flocknet:~$

Single RIB prefix entry

flock@flocknet:~$ flockc --af ipv4 -p 10.0.2.0/24
{"origin":"Ospfv2","next_hops":[{"intf_id":2,"ip_addr":"10.0.1.49"}]}
flock@flocknet:~$

All prefix entries in the RIB

flock@flocknet:~$ flockc --af ipv4 -p
{"ip_net":"0.0.0.0/0","origin":"Kernel","next_hops":[{"intf_id":5,"ip_addr":"192.168.22.1"}]}
{"ip_net":"10.0.1.0/24","origin":"Kernel","next_hops":[{"intf_id":2}]}
{"ip_net":"10.0.2.0/24","origin":"Ospfv2","next_hops":[{"intf_id":2,"ip_addr":"10.0.1.49"}]}
{"ip_net":"10.0.3.0/24","origin":"Kernel","next_hops":[{"intf_id":4}]}
{"ip_net":"10.0.4.0/24","origin":"Kernel","next_hops":[{"intf_id":3}]}
{"ip_net":"42.0.0.0/16","origin":"Kernel","next_hops":[{"intf_id":5,"ip_addr":"192.68.122.1"}]}
{"ip_net":"192.168.122.0/24","origin":"Kernel","next_hops":[{"intf_id":5}]}
flock@flocknet:~$

RIB Operation

Help

flockc rib -h

RIB Overview

flockc rib --af [ipv4 | ipv6 ]

RIB Prefixes

flockc rib --af [ ipv4 | ipv6 ] -p [<ip-network>]

Prefixes by route origin.

Origin can be bgp, kernel, ospfv2 or static.

flockc rib --af [ipv4 | ipv6 ] -p -o ospfv2

Longest Path Match (LPM)

flockc rib --af [ipv4 | ipv6 ] -l <ip-address>