Flock Routing Suite Client (flockrsc)

By design flockrsc can be run by a user with no special privileges. flockrsc connects to a Read-Only connection on flockrsd. flockrsd state can be viewed but cannot be changed. All output is in JSON format, making it suitable for consumption by humans or machines.

General Command Flags

General Flags can be included in any command.

-d, --detail
-h, --help           Prints help information
-J, --json           Output in JSON
-j, --json-pretty    Output in Pretty Print JSON
-u, --unsorted       Output in unsorted order

System State Commands

Help

flockrsc system -h

Overview

flockrsc system

All system interfaces

flockrsc system -i

Single interface

flockrsc system -i enp1s0

RIB State Commands

Help

flockrsc ribv4 -h

Overview

flockrsc ribv4

All prefixes

flockrsc ribv4 -p

Single prefix

flockrsc ribv4 -p 10.0.5.0/24

All prefixes by route origin

flockrsc ribv4 -p -o ospfv2

OSPFv2 State Commands

Help

flockrsc ospfv2 -h

Overview

flockrsc ospfv2

Overview of all areas

flockrsc ospfv2 -a

Overview of Area 20

flockrsc ospfv2 -a 20

or

flockrsc ospfv2 -a 0.0.0.20

All interfaces in Area 20

flockrsc ospfv2 -i -a 20

All neighbors on interface enp1s0 in Area 0

flockrsc ospfv2 -n -i enp1s0 -a 0

All neighbors on all interfaces in all areas

flockrsc ospfv2 -n -i -a

Autonomous System Link State Database

flockrsc ospfv2 -l

Area 0.0.0.0 Link State Database

flockrsc ospfv2 -a 0 -l

OSPFv2 network route table prefixes

flockrsc ospfv2 -p

OSPFv2 network route table by destination prefix

flockrsc ospfv2 -p 10.20.20.0/24

OSPFv2 router route table prefixes

flockrsc ospfv2 -P

OSPFv2 router route table by router id

flockrsc ospfv2 -P 10.20.100.22

Commonly used commands including sample output

Check status of flockrsd

flock@flocknet:~$ flockrsc system
{"software":"Flock Networks Routing Suite","version":"20.0.1","pid":371,"compile_mode":"Release","log_level":"info","uptime":{"days":0,"hours":0,"mins":8,"secs":52}}

Show all prefix's in the RIB

flock@flocknet:~$ flockrsc ribv4 -p
{"ip_net":"0.0.0.0/0","origin":"Kernel","next_hops":[{"intf_id":5,"ip_addr":"192.168.122.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.249"}]}
{"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.168.122.1"}]}
{"ip_net":"192.168.122.0/24","origin":"Kernel","next_hops":[{"intf_id":5}]}

Show all OSPFv2 neighbors, out of all interfaces, in all areas

flock@flocknet:~$ flockrsc ospfv2 -n -i -a
{"ospf_area_id":"0.0.0.0"}
{"ospf_intf":"enp1s0"}
{"id":"10.0.100.3","ip":"10.0.5.225","state":"Full","dr":"10.0.5.204","bdr":"10.0.5.225"}
{"ospf_area_id":"0.0.0.20"}
{"ospf_intf":"enp7s0"}
{"id":"10.20.100.20","ip":"10.20.20.189","state":"Full","dr":"10.20.20.189","bdr":"10.20.20.214"}

Show OSPFv2 Area 20 Link State Database

flock@flocknet:~$ flockrsc ospfv2 -a 20 -l
{"lsa_age":279,"lsa_opts":{"bits":2},"lsa_type":"Router","lsa_id":"10.0.100.4","lsa_router_id":"10.0.100.4","lsa_seq":-2147483646,"lsa_checksum":28411,"lsa_len":36}
{"lsa_age":266,"lsa_opts":{"bits":2},"lsa_type":"Router","lsa_id":"10.0.100.5","lsa_router_id":"10.0.100.5","lsa_seq":-2147483646,"lsa_checksum":22802,"lsa_len":36}
{"lsa_age":275,"lsa_opts":{"bits":2},"lsa_type":"Router","lsa_id":"10.20.100.20","lsa_router_id":"10.20.100.20","lsa_seq":-2147483644,"lsa_checksum":58508,"lsa_len":48}
{"lsa_age":271,"lsa_opts":{"bits":2},"lsa_type":"Router","lsa_id":"10.20.100.21","lsa_router_id":"10.20.100.21","lsa_seq":-2147483644,"lsa_checksum":53018,"lsa_len":48}
{"lsa_age":270,"lsa_opts":{"bits":2},"lsa_type":"Network","lsa_id":"10.20.23.191","lsa_router_id":"10.20.100.22","lsa_seq":-2147483646,"lsa_checksum":15710,"lsa_len":32}
{"lsa_age":290,"lsa_opts":{"bits":2},"lsa_type":"Network","lsa_id":"10.20.24.165","lsa_router_id":"10.20.100.22","lsa_seq":-2147483647,"lsa_checksum":37311,"lsa_len":28}
{"lsa_age":262,"lsa_opts":{"bits":2},"lsa_type":"NetworkSummary","lsa_id":"10.0.1.0","lsa_router_id":"10.0.100.4","lsa_seq":-2147483647,"lsa_checksum":30038,"lsa_len":28}
{"lsa_age":266,"lsa_opts":{"bits":2},"lsa_type":"NetworkSummary","lsa_id":"10.0.2.0","lsa_router_id":"10.0.100.5","lsa_seq":-2147483647,"lsa_checksum":25701,"lsa_len":28}
{"lsa_age":262,"lsa_opts":{"bits":2},"lsa_type":"AsbrSummary","lsa_id":"10.0.100.1","lsa_router_id":"10.0.100.4","lsa_seq":-2147483647,"lsa_checksum":6222,"lsa_len":28}
{"lsa_age":266,"lsa_opts":{"bits":2},"lsa_type":"AsbrSummary","lsa_id":"10.0.100.1","lsa_router_id":"10.0.100.5","lsa_seq":-2147483647,"lsa_checksum":4691,"lsa_len":28}

Changing the output format

By default the output is in JSON Lines format, which is JSON with newlines added to aid reading by a human.

flock@flocknet:~$ flockrsc ospfv2 -a -i -n 10.0.100.3
{"ospf_area_id":"0.0.0.0"}
{"ospf_intf":"enp1s0"}
{"id":"10.0.100.3","ip":"10.0.5.225","state":"Full","dr":"10.0.5.225","bdr":"10.0.5.204"}

Using the -j, --json-pretty flag the output is pretty printed JSON

flock@flocknet:~$ flockrsc ospfv2 -a -i -n 10.0.100.3 -j
[
  {
    "ospf_area_id": "0.0.0.0",
    "ospf_intfs": [
      {
        "ospf_intf": "enp1s0",
        "ospf_neighs": [
          {
            "id": "10.0.100.3",
            "ip": "10.0.5.225",
            "state": "Full",
            "dr": "10.0.5.225",
            "bdr": "10.0.5.204"
          }
        ]
      }
    ]
  }
]

Using the -J, --json flag the output is JSON

flock@flocknet:~$ flockrsc ospfv2 -a -i -n 10.0.100.3 -J
[{"ospf_area_id":"0.0.0.0","ospf_intfs":[{"ospf_intf":"enp1s0","ospf_neighs":[{"id":"10.0.100.3","ip":"10.0.5.225","state":"Full","dr":"10.0.5.225","bdr":"10.0.5.204"}]}]}]

Remote Connectivity

The client can connect and retrieve the same types of information from a remote router. Just add the --host option to any command. The host parameter can be a hostname or an IP Address.

flock@flocknet:~$ flockrsc ribv4 -p -J --host flocknet1
{"ip_net":"0.0.0.0/0","origin":"Ospfv2","next_hops":[{"intf_id":2,  "ip_addr":"10.0.1.168"},{"intf_id":4,"ip_addr":"10.0.4.203"}]}
{"ip_net":"10.0.1.0/24","origin":"Kernel","next_hops":[{"intf_id":2}]}
{"ip_net":"10.0.2.0/24","origin":"Kernel","next_hops":[{"intf_id":3}]}
...

For more information on working with this REST API, please see Appendix D.