Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Connecting to Routers

flockmcp is a client of the same gRPC API that flockc uses. If flockc -e <endpoint> sys overview works from the host flockmcp runs on, flockmcp can reach that router at the same endpoint.

The address flockd serves its API on

By default flockd serves its API on the IPv6 loopback address, port 50051, which only programs on the router itself can reach. To reach a router from another host, set the address in the system section of its /etc/flockd/flockd.json:

"system": {
    "api": {
        "grpc": {
            "bind_ip_addr": "192.0.2.1",
            "bind_port": 50051
        }
    }
}

Both fields are optional and default to ::1 and 50051. flockd reads them only when it starts. The address must be one the router has when flockd starts. :: serves the API on every address of the router.

Security

The flockd API has no authentication and no encryption. Anyone who can reach the address can read the router's state.

  • Serve the API on a management network that only trusted hosts can reach, not on an address reachable from the networks the router forwards for.
  • Leave allow_actions off on a router unless an assistant is meant to reset BGP neighbors on it.
  • flockmcp cannot change a router's configuration. allow_config on the router is not needed and can stay off.

Versions

The major and minor version of flockmcp are those of the flockd release line it is built for. Its patch number is its own, as flockmcp and flockd are each patched only when they change.

flockmcp asks each router for its flockd version when it first connects to it, and again whenever it has had to connect anew. It talks to a flockd whose major and minor version are the same as its own: flockmcp 26.5.0 talks to flockd 26.5.0 and 26.5.3, and not to 26.4.x or 26.6.x.

A router running another version is refused. Every tool asked about it reports the two versions, and list_daemons shows it with version_match false. The other routers are not affected.

When routers are upgraded to a new flockd minor release, install the flockmcp of that release, even where the release changed nothing flockmcp uses. Routers on two releases need a flockmcp of each, registered with the assistant under two names.

A router that is down or restarts

A router that cannot be reached is reported as unreachable by any tool that asks it, with its endpoint and the reason. flockmcp tries again the next time it is asked.

A router that restarts is connected to again by itself. A call that is the first to reach a router after it restarted has the router's version checked, and is asked again once. A call the router stops under is reported as unreachable: ask again. A BGP neighbor reset is never sent twice: see Changing a Router.