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

System Component

Configuration Overview

The system configuration is held under the top level system object in /etc/flockd/flockd.json. The system object is optional, and an empty one is the same as one left out.

flock@flocknet:~$ cat /etc/flockd/flockd.json
{
    "system": {}
}
flock@flocknet:~$

Configuration in detail

Filtering interfaces in system component

System component receives interfaces from the Linux kernel. Interfaces not used by any routing component can be filtered out at the system component level by using intf_denylist JSON object.

This configuration will ignore interface eth0 and all interfaces starting with en:

"system": {
    ...
    "intf_denylist": [
        # Specify the entire interface name i.e. "eth0"
        # or use ^ to match the start of interface names
        #   e.g. "^en" will match all interfaces that start with "en"
        # Multiple interface names and patterns can be used
        "eth0",
        "^en"
    ]
},

The intf_denylist object is optional. If it is not specified, all interfaces present in kernel will also be present in system component. The filtered out interfaces will not be present in the flockc sys list-interfaces output.

A changed intf_denylist applies to the interfaces flockd already holds: one the new list denies leaves the system component, taking the connected routes it gave the RIB with it, and one the new list allows is read from the kernel again and comes back.

Draining traffic for maintenance

Setting maintenance_mode tells OSPF to advertise this router as undesirable transit, so traffic drains away from it before the work starts. OSPF raises the metric of its transit links and of the external prefixes it originates (RFC 6987), leaving the prefixes local to the router reachable. BGP does not yet act on the setting beyond re-advertising its routes unchanged:

"system": {
    ...
    "maintenance_mode": true
},

The key is optional and defaults to false. It is configuration rather than a command so that a router left draining is still draining after a restart. flockd reloads flockd.json without a restart, so clearing it puts the router back into service.

flockc sys overview reports the current setting as maintenance_mode.

gRPC API endpoint

The optional api.grpc object sets the address and port flockd serves its gRPC API on, which flockc and other gRPC clients connect to. Both fields default to the values shown. flockd reads api.grpc only when it starts. Changing it in flockd.json is logged and left unapplied until flockd restarts; the API stays where it is:

"system": {
    ...
    "api": {
        "grpc": {
            "bind_ip_addr": "::1",
            "bind_port": 50051
        }
    }
},

gRPC API access

flockd always serves reads over its gRPC API. Two optional keys under api decide whether it also accepts requests that change something:

  • allow_config, default false, admits changes to the running configuration, such as flockc bgp config apply. It is off because flockd.json owns the configuration: a change made over gRPC is overwritten when the file is next reloaded.
  • allow_actions, default false, admits requests that act on a running protocol without changing its configuration, such as flockc bgp vrf default neigh 10.0.0.1 reset hard.

A refused request fails with PermissionDenied and changes nothing. Both keys are live: flockd applies a change to either when it reloads flockd.json, with no restart. The defaults, written out:

"system": {
    ...
    "api": {
        "allow_config": false,
        "allow_actions": false
    }
},

Operational State Overview

Check status of flockd

flock@r70:~$ flockc sys overview
{"host_info":{"hostname":"r70", ...},"system_info":{"name":"flockd","description":"The Flock Networks Ltd Routing Suite Daemon","profile":"Release", ...},"pid":1234,"log_level":"info","uptime":"days: 0, hours: 0, mins: 0, secs: 19","enabled_protocols":["BGPv4","OSPFv2","Static"],"software_errors":0, ...}

Show all system interfaces

flock@r70:~$ flockc sys list-interfaces
[{"intf_name":"lo","intf_id":1, ...,"intf_type":"loopback","intf_mtu":65536,"intf_mac":null,"intf_state":"up","vrf":{"vrf_id":254,"vrf_name":"default"},"ip_prefixes":["127.0.0.1/8","70.0.100.70/32","::1/128"], ...},{"intf_name":"r70-n70","intf_id":125675, ...,"intf_type":"broadcast","intf_mtu":1500,"intf_mac":"52:54:00:70:00:70","intf_state":"up","vrf":{"vrf_id":254,"vrf_name":"default"},"ip_prefixes":["70.0.70.70/24","fc00:46:46::46/64", ...], ...}, ...]

held is true for an interface whose name a newer report has given to another interface in the same VRF. A held interface is withdrawn from the other components until its name is free.

Show single system interface

flock@r70:~$ flockc sys interface r70-n70
{"intf_name":"r70-n70","intf_id":125675, ...,"intf_state":"up","vrf":{"vrf_id":254,"vrf_name":"default"},"ip_prefixes":["70.0.70.70/24", ...], ...}

The interface is looked up by name in one VRF, the default VRF unless --vrf <vrf-name> names another. An interface in another VRF is not found without it.

flock@r70:~$ flockc sys interface r70-n71 --vrf cust1

Show all vrfs

flock@r70:~$ flockc sys list-vrfs
[{"vrf_id":254,"vrf_name":"default","underlay_vrf_name":null,"kernel_intf_name":null, ...}]

Show single vrf

flock@r70:~$ flockc sys vrf default
{"vrf_id":254,"vrf_name":"default","underlay_vrf_name":null,"kernel_intf_name":null, ...}

System Operation

Help

flockc sys --help

Overview

flockc sys overview

All system interfaces

flockc sys list-interfaces

Single interface

flockc sys interface <interface-name> [--vrf <vrf-name>]

All vrfs

flockc sys list-vrfs

Single vrf

flockc sys vrf <vrf-name>