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 dataplane for use when forwarding packets. By default, flock uses the Linux kernel as dataplane, but it can be configured to use other dataplanes.
Operational State
Stats
flock@r70:~$ flockc rib vrf default stats
{"v4":{"total_route_count":12,"active_route_count":12,"protocol_stats":[{"origin":"Connected","counters":{"total_route_count":4,"active_route_count":4},"vpn_counters":null}, ...]},"v6":{"total_route_count":3, ...}}
Longest Prefix Match (LPM) for destination
The matching prefix is returned alongside its entry.
-
fib_ip_nhsare the resolved next hops taken from the 'best' protocolflock@r70:~$ flockc rib vrf default lpm 70.0.70.1 ["70.0.70.0/24",{"protos":[{"admin_dist":0,"origin":"Connected", ...,"ip_nhs":[{"ConnectedNh":{...}}],"last_modified":"2026-08-03T09:14:22.481Z"}],"fib_ip_nhs":[{"ConnectedNh":{"table_id":{"vrf_id":254,"afi":"ipv4-unicast"},"intf_id":125675, ...}}], ...}]
Each entry in protos carries last_modified, when that protocol's route to the prefix last changed.
Single RIB prefix entry
flock@r70:~$ flockc -f json-pretty rib vrf default lookup 70.0.0.0/8
{
"protos": [
{
"admin_dist": 1,
"origin": {
"Static": "Conf"
},
...
"ip_nhs": [
{
"SpecialNh": {
"table_id": {
"vrf_id": 254,
"afi": "ipv4-unicast"
},
"special_nh_type": "Discard",
...
}
}
],
...
}
],
"fib_ip_nhs": [
{
"SpecialNh": {
...
"special_nh_type": "Discard",
...
}
}
],
...
}
All prefix entries in the RIB
Walk starts at <root> and returns all prefixes within. Use 0.0.0.0/0 or ::/0 for the full IPv4 / IPv6 table. Only the 'best' origin protocol is shown per prefix.
flock@r70:~$ flockc rib vrf default walk 0.0.0.0/0
[["50.0.0.0/8",{"protos":[{"admin_dist":20,"origin":"Bgp", ...,"ip_nhs":[{"RecursiveNh":{ ...,"ip_addr":"90.0.93.61", ...}}], ...}],"fib_ip_nhs":[{"AttachedNh":{ ...,"ip_addr":"90.0.93.61", ...}}], ...}],["70.0.0.0/8",{"protos":[{"admin_dist":1,"origin":{"Static":"Conf"}, ...}], ...}],["70.0.70.0/24",{"protos":[{"admin_dist":0,"origin":"Connected", ...}], ...}], ...]
Connected routes
Connected routes installed by the system component can be looked up or walked independently via the connected subcommand. The walk selects one address family and defaults to IPv6:
flockc rib vrf <vrf-name> connected lookup <ip-network>
flockc rib vrf <vrf-name> connected walk [--af ipv4 | ipv6]
RIB Operation
Help
flockc rib --help
RIB stats
flockc rib vrf <vrf-name> stats
RIB prefix lookup
flockc rib vrf <vrf-name> lookup <ip-network>
RIB walk
flockc rib vrf <vrf-name> walk <root> [--start-from <prefix>] [--max-entries <N>]
Longest Prefix Match (LPM)
flockc rib vrf <vrf-name> lpm <ip-address>
Connected route lookup / walk
flockc rib vrf <vrf-name> connected lookup <ip-network>
flockc rib vrf <vrf-name> connected walk [--af ipv4 | ipv6]
Label RIB (LRIB)
The Label RIB manages MPLS label bindings programmed by protocols such as BGP and OSPF Segment Routing.
LRIB stats
flockc lrib stats
LRIB label lookup
flockc lrib lookup <label>
LRIB walk
flockc lrib walk
Multicast RIB (mRIB)
The multicast RIB holds the (S,G) entries flockd programs into the multicast forwarding plane, written by PIM. It is documented in the Multicast RIB Component chapter.