Flock Routing Suite Client: flockc
flockc is the CLI client bundled with flockd for monitoring and configuring the router. It talks to flockd over gRPC (Protocol Buffers over HTTP/2) and supports both read operations (querying operational state) and write operations (applying configuration updates, e.g. BGP neighbor and VRF configuration).
flockc connects to the gRPC endpoint (default http://[::1]:50051) and supports multiple output formats.
Global Options
flockc [OPTIONS] <COMMAND>
Options:
-e, --endpoint <ENDPOINT> [env: FLOCK_ENDPOINT=] [default: http://[::1]:50051]
-f, --format <FORMAT> [default: json] [possible values: debug, debug-pretty, json, json-pretty, yaml]
-h, --help Print help
-V, --version Print version
-e selects the gRPC endpoint and -f the output format. Every command and subcommand accepts --help.
Connecting to a Remote Router
By default, flockc connects to the local flockd instance via IPv6 loopback, which is also the only address flockd listens on unless the system configuration names another:
"system": {
"api": {
"grpc": {
"bind_ip_addr": "::",
"bind_port": 50051
}
}
}
Both fields are optional and default to ::1 and 50051. flockd reads them only when it starts, so a change to them takes effect the next time flockd starts. To connect to a remote router, set the endpoint:
flockc -e http://10.0.1.1:50051 sys overview
Or via the FLOCK_ENDPOINT environment variable:
export FLOCK_ENDPOINT=http://10.0.1.1:50051
flockc sys overview
Commands
Each top-level command queries one component. This chapter covers sys and bgp in detail; the component chapters cover the rest.
| Command | Queries | Documented in |
|---|---|---|
sys | System overview, VRFs and interfaces | System Component |
bgp | BGP state and configuration | This chapter and BGP Component |
static | Static routes | Static Component |
rib | Unicast RIB | RIB Component |
lrib | Label RIB | RIB Component |
mrib | Multicast RIB | Multicast RIB Component |
igmp | IGMP interfaces and group membership | IGMP Component |
bfd | BFD overview, interfaces and sessions | BFD Component |
ospfv2 | OSPFv2 instances | OSPFv2 Component |
ospfv3 | OSPFv3 instances | OSPFv3 Component |
isis | IS-IS VRFs, interfaces, adjacencies, link-state database and routes | IS-IS Component |
pim | PIM VRFs, interfaces, neighbors and (S,G) state | PIM Component |
subscribe | A stream of operational-state changes, printed as each arrives until interrupted | IS-IS Component, PIM Component |
System Commands
System Overview
Returns system information including hostname, software version, uptime, enabled protocols, software error count, and whether maintenance mode is set.
$ flockc -f json-pretty sys overview
{
"host_info": {
"hostname": "R01",
"domain": null,
...
},
"system_info": {
"name": "flockd",
"description": "The Flock Networks Ltd Routing Suite Daemon",
...
"version": "0.0.2",
...
},
"fire_info": {
"name": "fire",
"description": "Flock Internet Routing Engine (FIRE)",
...
"version": "0.1.0",
...
},
"pid": 12345,
"log_level": "info",
"uptime": "days: 1, hours: 3, mins: 22, secs: 15",
"enabled_protocols": ["BGPv4", "OSPFv2", "Static"],
"software_errors": 0,
"global_thread_pool_size": 10,
"maintenance_mode": false
}
sys vrf <name>, sys list-interfaces and sys interface <name> are described in the System Component chapter.
List VRFs
Returns all VRFs configured on the system.
$ flockc sys list-vrfs
[{"vrf_id":254,"vrf_name":"default","underlay_vrf_name":null,...}]
BGP Commands
BGP Overview
Returns the BGP instance overview including BGP ID, ASN, route counts per VRF, and neighbor summary.
$ flockc -f json-pretty bgp overview
{
"id": "70.0.100.70",
"asn": 70,
"route_server": false,
"route_reflector": false,
...
"total_event_loops": 571,
...
"routes": {
"unicast_routes": {
"default": {
"ipv4_unicast": { "route_count": 3, "attr_list_store_count": 1 },
"ipv6_unicast": { "route_count": 0, "attr_list_store_count": 0 }
}
},
"vpn_routes": {}
},
"neighbor_summary": {
"default": {
"count": 4,
"established": 4,
"send_converged": 4,
"recv_converged": 4
}
}
}
List BGP VRFs
$ flockc bgp list-vrfs
[{"vrf_id":254,"vrf_name":"default","vrf_info":{...,"neighs":["90.0.93.61","70.0.100.73 70.0.100.70",...]},...}]
List BGP Neighbors
One row per neighbor, with its session state at a glance. Rows come ordered by VRF name and then by neighbor: a neighbor at a global address before one at a link-local address, then by its address (IPv4 before IPv6), then by its source address.
$ flockc bgp list-neighbors
{"entries":[{"vrf_name":"default","neigh_key":"50.0.20.50 60.0.20.61","hostname":"r50","asn":50,"local_as":60,"neigh_type":"External","state":"Established","last_session_state_change":"...","last_notify_send":null,"last_notify_recv":null,"disabled":false,"bfd_status":null,"afis":{"ipv4-unicast":{"n_adj_rib_in_prefixes":1,"n_adj_rib_out_prefixes":2}}},...],"finished":true}
# One VRF's neighbors
$ flockc bgp list-neighbors --vrf default
# A chunk at a time
$ flockc bgp list-neighbors --max-entries 1
$ flockc bgp list-neighbors --max-entries 1 --start-from default "50.0.20.50 60.0.20.61"
state is the established connection's state, or that of the further advanced of the outgoing and incoming connections when neither is established; last_notify_send and last_notify_recv are that connection's, or the other connection's where it has seen none. disabled is set for a neighbor held down by configuration. bfd_status is null without BFD, and until its session first reports. afis holds, for each address family the neighbor is configured for, the prefixes in its adj-RIB-in and adj-RIB-out.
--max-entries N returns at most N rows, and --start-from <vrf> <neigh_key> resumes after the row a previous chunk ended on, named by its vrf_name and neigh_key. finished is true when no rows follow the last one returned. flockc bgp vrf <vrf> neigh <addr> show has a neighbor's full detail.
BGP Event Log
Returns the BGP event log showing neighbor state changes.
$ flockc -f json-pretty bgp event-log
{
"object_oper": {
"db": [
{
"event": "AddOrUpdate",
"object_desc": "BGP Peer VrfId(254) 90.0.93.61",
"time": "2026-02-27T13:42:00.015Z"
},
{
"event": "Up",
"object_desc": "BGP Peer VrfId(254) 90.0.93.61",
"time": "2026-02-27T13:42:00.185Z"
},
...
]
}
}
BGP VRF Commands
All VRF-scoped commands use the form flockc bgp vrf <name> <command>.
Show a VRF
Returns the named VRF's row from bgp list-vrfs, including its neighbor list.
$ flockc bgp vrf default show
Unicast RIB Lookup
Look up a single prefix in the BGP unicast RIB.
$ flockc bgp vrf default rib lookup 50.0.0.0/8
Unicast RIB Walk
Walk the BGP unicast RIB starting from a root prefix. Entries come in prefix order, and a large table can be walked a chunk at a time: --max-entries N returns at most N entries, and --start-from <prefix> resumes after the prefix a previous chunk ended on.
# Walk all routes
$ flockc bgp vrf default rib walk 0.0.0.0/0
# Walk with pagination (1 entry at a time)
$ flockc bgp vrf default rib walk 0.0.0.0/0 --max-entries 1
# Continue from a specific prefix
$ flockc bgp vrf default rib walk 0.0.0.0/0 --start-from 60.0.0.0/8 --max-entries 1
The response carries the entries and a finished flag, true when no entries follow the last one returned, including when the chunk is exactly full. A walk that finds no entries -- nothing under the root, or a resume at or past the last entry -- returns none with finished set.
Unicast RIB Statistics
# Basic counters
$ flockc bgp vrf default rib stats
# Include memory usage details
$ flockc bgp vrf default rib stats --memory
Returns IPv4 and IPv6 counters: total prefixes, path counts by type (iBGP, eBGP, originated, redistributed, VPN-imported, EVPN-imported), and optionally memory usage per RIB entry.
De-aggregation Labels
$ flockc bgp vrf default rib deagg-labels
Redistribution Policy
$ flockc bgp vrf default redist-policy
Returns the redistribution policy status and statistics including hit counts and accept/reject counters.
VPN Policy Statistics
$ flockc bgp vrf default vpn policy-stats
BGP Neighbor Commands
Neighbor commands use the form flockc bgp vrf <vrf> neigh <addr> <command>.
The neighbor address is the neighbor's IP address (90.0.93.61). A neighbor configured with a local source address, keyed "70.0.100.72 70.0.100.70" in the configuration, is named by its own address alone (70.0.100.72). A link-local IPv6 neighbor also names its interface as a scope (fe80::2%eth0).
Show Neighbor
# Basic neighbor info
$ flockc bgp vrf default neigh 90.0.93.61 show
# Include detailed statistics
$ flockc bgp vrf default neigh 90.0.93.61 show --stats
Returns neighbor state (Established/Idle/etc.), capabilities, timers, keepalive counters, dst_resolved (whether the RIB resolves the neighbor's address), and optionally per-AFI statistics including policy hit counts and adj-rib prefix counts.
Reset Neighbor
$ flockc bgp vrf default neigh 90.0.93.61 reset soft-in
$ flockc bgp vrf default neigh 90.0.93.61 reset soft-out
$ flockc bgp vrf default neigh 90.0.93.61 reset hard
$ flockc bgp vrf default neigh 90.0.93.61 reset refresh-in
$ flockc bgp vrf default neigh 90.0.93.61 reset refresh-out
flockd refuses a reset with PermissionDenied unless flockd.json sets system.api.allow_actions to true; see gRPC API access.
Adjacency RIB Commands
Look up one prefix in, or walk the whole of, the routes received from or
advertised to a specific neighbor. Every scope takes the direction, in
or out, before the command.
# Routes received from neighbor (adj-rib-in)
$ flockc bgp vrf default neigh 90.0.93.61 adj-rib-unicast in walk 0.0.0.0/0
# Routes advertised to neighbor (adj-rib-out)
$ flockc bgp vrf default neigh 90.0.93.61 adj-rib-unicast out walk 0.0.0.0/0
# One prefix rather than the whole table
$ flockc bgp vrf default neigh 90.0.93.61 adj-rib-unicast in lookup 10.0.0.0/24
# RTC adj-rib
$ flockc bgp vrf default neigh 90.0.93.61 adj-rib-rtc in walk [--start-from <rtc-net>] [--max-entries N]
$ flockc bgp vrf default neigh 90.0.93.61 adj-rib-rtc in lookup <rtc-net>
# VPN adj-rib, keyed by route distinguisher and prefix
$ flockc bgp vrf default neigh 90.0.93.61 adj-rib-vpn in lookup <rd> <ip-net>
$ flockc bgp vrf default neigh 90.0.93.61 adj-rib-vpn in walk <rd> <ip-net> [--start-from-rd <rd>] [--start-from-ip-net <ip-net>] [--max-entries N] [--walk-rds]
# Private adj-rib, which takes the address family before the direction
$ flockc bgp vrf default neigh 90.0.93.61 adj-rib-private ipv4-unicast in walk 0.0.0.0/0
The unicast, VPN, private and RTC adj-rib walks are paged as the RIB walks are. A private adj-rib walk under a root of the other address family is refused.
Each adj-rib-in path carries not_in_rib_reason, which says why the path is not in the BGP RIB; see the BGP Component chapter.
BGP VPN RIB Commands
VPN RIB Lookup
$ flockc bgp vpn-rib lookup <rd> <ip-net>
VPN RIB Walk
$ flockc bgp vpn-rib walk <rd> <ip-net> [--start-from-rd <rd>] [--start-from-ip-net <ip-net>] [--max-entries N] [--walk-rds]
Walks the subnets of <ip-net> in <rd>, or in every RD from <rd> onwards with --walk-rds, in (RD, prefix) order. It is paged as the unicast RIB walk is, with --start-from-rd and --start-from-ip-net together naming the prefix to resume after.
VPN RIB Statistics
$ flockc bgp vpn-rib stats [--af <ipv4|ipv6>] [--rd <rd>] [--memory]
BGP RTC RIB Commands
RTC RIB Lookup
$ flockc bgp rtc-rib lookup <rtc-net>
An RTC network is either Default or origin_as:<asn>,<route-target>, for example origin_as:200,route-target:0:100:100. The same form is taken by adj-rib-rtc ... lookup and by --start-from on either RTC walk, and a malformed one is refused before any request is sent.
RTC RIB Walk
$ flockc bgp rtc-rib walk [--start-from <rtc-net>] [--max-entries N]
The walk is paged as the unicast RIB walk is, with --start-from naming the RTC network to resume after.
BGP AFI RIB Commands
Query AFI-specific RIBs (e.g., EVPN).
$ flockc bgp vrf default afi-rib <afi> lookup <prefix>
$ flockc bgp vrf default afi-rib <afi> walk <root> [--start-from <prefix>] [--max-entries N]
The walk is paged as the unicast RIB walk is. A walk of an IPv4 or IPv6 AFI under a root of the other address family is refused.
BGP EVPN Commands
$ flockc bgp evpn rib walk [<rd>] [--start-from <prefix>] [--max-entries N]
$ flockc bgp evpn rib lookup <rd> <ip-addr>
$ flockc bgp evpn nve walk [--start-from <vni>] [--max-entries <N>]
$ flockc bgp evpn nve lookup <vni>
$ flockc bgp evpn es walk [--start-from <esi>] [--max-entries <N>]
$ flockc bgp evpn es lookup <esi>
The NVE walk and the Ethernet Segment walk are paged the same way, in VNI and ESI order: --start-from names the VNI or ESI to resume after, as lookup takes it, and finished is true when no entries follow the last one returned.
The EVPN RIB walk is paged as the unicast RIB walk is, in (RD, route) order. --start-from names the prefix to resume after as the RD in brackets followed by the route's type and key fields, each in brackets: for example [1:10.0.1.1:2]:[3]:[0]:[10.0.1.1] for a Type-3 route, or [1:10.0.1.1:2]:[2]:[52:54:00:12:34:56]:[0]:[10.10.10.1] for a Type-2 route with an IP.
BGP Configuration Commands
The gRPC API supports reading and updating BGP configuration. Configuration changes use a pending-config workflow: changes are staged locally in a .bgp_pending_config file, then applied atomically to the running router.
Show Current Configuration
# Full configuration
$ flockc bgp config show
# Configuration for a specific VRF
$ flockc -f json-pretty bgp config show --vrf default
[
{
"name": "default",
"multipath": false,
"neighs": [
{
"key": { "dst": { "version": { "V4": 1509973309 } }, "src": null },
"asn": 60,
"local_as": 70,
"route_reflector_client": false,
"next_hop_self": false,
"disabled": false,
"connect_mode": "both",
"next_hop_source": null,
...
}
],
"networks": [
{ "prefix": "70.0.0.0/8", "originate_always": false }
],
...
}
]
Pending Configuration Workflow
Configuration changes follow a four-step workflow: initialize, stage, review, apply.
flockd refuses the apply with PermissionDenied unless flockd.json sets system.api.allow_config to true. It is off by default because a change applied over gRPC is overwritten when flockd.json is next reloaded; see gRPC API access.
Step 1: Initialize
Create a fresh pending configuration staging file:
$ flockc bgp config init
initialized .bgp_pending_config
Step 2: Stage Changes
Stage one or more changes. Multiple changes can be staged before applying:
$ flockc bgp config set --asn 65001
$ flockc bgp config vrf default set --multipath true
$ flockc bgp config vrf default neigh 10.0.0.1 set --asn 65002
Step 3: Review Pending Changes
Inspect what will be applied before committing:
$ flockc bgp config show-pending
Step 4: Apply
Apply all staged changes atomically to the running router:
$ flockc bgp config apply
config applied
Example: Adding a BGP Neighbor
# Initialize pending config
$ flockc bgp config init
initialized .bgp_pending_config
# Stage the new neighbor
$ flockc bgp config vrf default neigh 10.99.99.1 set --asn 65099 --local-as 70
# Review - the pending config shows the staged addition
$ flockc bgp config show-pending
{"asn":null,...,"vrfs":{"clear":false,"ops":[{"name":"default","delete":false,
"neighs":{"clear":false,"ops":[{"key":{"dst":{"version":{"V4":174285569}},
"src":null,"zone":null},"delete":false,"asn":{"v":{"Set":65099}},
"local_as":{"v":{"Set":70}},...}]}}]}}
# Apply to the running router
$ flockc bgp config apply
config applied
# Verify - neighbor count increased and the new neighbor is visible
$ flockc bgp overview
{...,"neighbor_summary":{"default":{"count":5,"established":4,...}}}
$ flockc bgp vrf default neigh 10.99.99.1 show
{"common":{"neigh_key":"10.99.99.1","asn":65099,"local_as":70,
"neigh_type":"External","connect_mode":"both",...},...}
Example: Deleting a BGP Neighbor
# Initialize pending config
$ flockc bgp config init
initialized .bgp_pending_config
# Stage the deletion
$ flockc bgp config vrf default neigh 10.99.99.1 delete
# Review - the pending config shows delete:true
$ flockc bgp config show-pending
{"asn":null,...,"vrfs":{"clear":false,"ops":[{"name":"default","delete":false,
"neighs":{"clear":false,"ops":[{"key":{"dst":{"version":{"V4":174285569}},
"src":null,"zone":null},"delete":true,...}]}}]}}
# Apply to the running router
$ flockc bgp config apply
config applied
# Verify - neighbor count decreased and the neighbor is gone
$ flockc bgp overview
{...,"neighbor_summary":{"default":{"count":4,"established":4,...}}}
$ flockc bgp vrf default neigh 10.99.99.1 show
null
Configuration Set Options
Boolean options take an explicit true or false, so a staged change can turn a setting off as well as on.
Global BGP settings:
$ flockc bgp config set [--asn <ASN>] [--route-server <true|false>] [--route-reflector <true|false>]
VRF settings:
$ flockc bgp config vrf <name> set [--multipath <true|false>] [--redist-policy <policy>]
$ flockc bgp config vrf <name> delete
Neighbor settings:
$ flockc bgp config vrf <name> neigh <addr> set \
[--asn <ASN>] [--local-as <ASN>] \
[--route-reflector-client <true|false>] [--next-hop-self <true|false>] \
[--disabled <true|false>] [--connect-mode <mode>] \
[--next-hop-source <source>] \
[--auth-password-file <path> | --clear-auth-password-file]
$ flockc bgp config vrf <name> neigh <addr> delete
--connect-mode takes active, passive or both. --next-hop-source takes outgoing-interface or local-address; see the BGP Component chapter. --auth-password-file names a TCP-MD5 key file by its absolute path on the flockd host, and --clear-auth-password-file removes the key; see the BGP Component chapter.
Output Formats
flockc supports five output formats via the -f flag:
| Format | Description |
|---|---|
json | Compact JSON (default) |
json-pretty | Pretty-printed JSON |
yaml | YAML format |
debug | Rust debug format |
debug-pretty | Rust debug format, pretty-printed |
Example using YAML:
$ flockc -f yaml bgp vrf default rib stats
v4:
counters:
total_prefixes: 3
num_ibgp_regular_paths: 0
num_ebgp_regular_paths: 2
num_originated_paths: 1
...
v6:
counters:
total_prefixes: 0
...
An object that does not exist is printed as null (or an empty list), and errors are written to standard error. flockc exits with status 0 when a command succeeds, including a lookup that finds nothing, and non-zero when it fails -- a command line it cannot parse, a connection it cannot make, or a request flockd refuses.
3rd Party gRPC Clients
Since the gRPC API uses standard Protocol Buffers and HTTP/2, any gRPC client library can connect to flockd. The .proto service definitions are located in the platform_support/flock_grpc/proto/ directory.
Available Services
A service is served only when flockd is built with the component behind it.
| Service | Proto File | Description |
|---|---|---|
flock.sys.Sys | sys_oper.proto | System overview, VRFs and interfaces |
flock.bgp.Bgp | bgp_oper.proto | BGP operational state, including the running configuration |
flock.bgp.BgpAction | bgp_action.proto | BGP neighbor reset |
flock.bgp.BgpRunningConfig | bgp_config.proto | BGP running-configuration updates |
flock.static_routing.StaticRouting | static_routing_oper.proto | Static route state |
flock.rib.Rib | rib_oper.proto | Unicast RIB state |
flock.lrib.LRib | lrib_oper.proto | Label RIB state |
flock.mrib.Mrib | mrib_oper.proto | Multicast RIB state |
flock.bfd.Bfd | bfd_oper.proto | BFD overview, interfaces and sessions |
flock.ospf.Ospf | ospf_oper.proto | OSPFv2 and OSPFv3 state |
flock.isis.Isis | isis_oper.proto | IS-IS state, and a stream of adjacency changes |
flock.pim.Pim | pim_oper.proto | PIM state, and a stream of per-interface changes |
flock.igmp.Igmp | igmp_oper.proto | IGMP interfaces and group membership |
Example: Connecting with grpcurl
flockd does not serve gRPC reflection, so give grpcurl the proto files:
# List the services a proto file defines
grpcurl -import-path platform_support/flock_grpc/proto -proto sys_oper.proto list
# Get system overview
grpcurl -plaintext -import-path platform_support/flock_grpc/proto -proto sys_oper.proto \
'[::1]:50051' flock.sys.Sys/GetOverview
# Get BGP overview
grpcurl -plaintext -import-path platform_support/flock_grpc/proto -proto bgp_oper.proto \
-d '{}' '[::1]:50051' flock.bgp.Bgp/GetOverview
Example: Connecting with Python
import grpc
# Generated from sys_oper.proto and common.proto using grpc_tools.protoc
import sys_oper_pb2, sys_oper_pb2_grpc
channel = grpc.insecure_channel('[::1]:50051')
stub = sys_oper_pb2_grpc.SysStub(channel)
response = stub.GetOverview(sys_oper_pb2.GetOverviewRequest())
print(response)
gRPC Command Reference
The RPCs of the system and BGP services are listed below. Each other service's RPCs are listed in its proto file.
System Service RPCs (flock.sys.Sys)
| RPC | Description |
|---|---|
GetOverview | System overview (hostname, version, uptime, protocols, errors, maintenance mode) |
ListVrfs | List all VRFs |
GetVrf | One VRF, by name |
ListInterfaces | List all interfaces |
GetInterface | One interface, by VRF name and interface name |
BGP Operational Service RPCs (flock.bgp.Bgp)
| RPC | Description |
|---|---|
GetOverview | BGP instance overview (ASN, BGP ID, route counts, neighbor summary) |
ListVrfs | List BGP VRFs with neighbor info |
GetNeighbor | Neighbor details with optional statistics |
ListNeighbors | One row per neighbor with its session state, with pagination |
GetEventLog | BGP event log |
GetRedistPolicy | Route redistribution policy and stats |
GetVpnPolicyStats | VPN import/export policy stats |
UnicastRibLookup | Look up a single unicast route |
UnicastRibWalk | Walk the unicast RIB with pagination |
UnicastRibStats | Unicast RIB statistics with optional memory |
GetSourceDeAggLabels | De-aggregation label information |
VpnRibLookup | Look up a single VPN route |
VpnRibWalk | Walk the VPN RIB with pagination |
VpnRibStats | VPN RIB statistics |
RtcRibLookup | Look up a single RTC route |
RtcRibWalk | Walk the RTC RIB with pagination |
AfiRibLookup | AFI-specific RIB lookup |
AfiRibWalk | AFI-specific RIB walk |
AdjRibUnicastLookup | Adjacency RIB unicast lookup |
AdjRibUnicastWalk | Adjacency RIB unicast walk |
AdjRibVpnLookup | Adjacency RIB VPN lookup |
AdjRibVpnWalk | Adjacency RIB VPN walk |
AdjRibRtcLookup | Adjacency RIB RTC lookup |
AdjRibRtcWalk | Adjacency RIB RTC walk |
AdjRibPrivateLookup | Adjacency RIB private lookup |
AdjRibPrivateWalk | Adjacency RIB private walk |
EvpnRibLookup | EVPN RIB lookup |
EvpnRibWalk | EVPN RIB walk, optionally for one RD |
EvpnNveLookup | EVPN NVE state for one VNI |
EvpnNveWalk | Walk the EVPN NVE state with pagination |
EvpnEsLookup | One EVPN Ethernet Segment |
EvpnEsWalk | All EVPN Ethernet Segments |
GetBgpConfig | Read the full BGP running configuration |
BGP Action Service RPCs (flock.bgp.BgpAction)
| RPC | Description |
|---|---|
ResetNeighbor | Reset a BGP neighbor session |
BGP Running Configuration Service RPCs (flock.bgp.BgpRunningConfig)
| RPC | Description |
|---|---|
UpdateBgpConfig | Apply a configuration update |