Static Component

Configuration Overview

The static route configuration is held under the top level static object in /etc/flockd/flockd.json. If the static object exists static routes will be enabled and the static master thread will be spawned.

In the minimal configuration file below;

  • The network object is used to specify the static route prefix. The ip_prefix can be either IPv4 or IPv6.

  • The nhs object is used to specify a set of next-hop(s) for the static route

    • Each next-hop in the set can be either an ip-address (ip) of the next-hop or can be a combination of an ip-address as well as the outgoing interface name (intf_name).
  • The format is the same for both IPv4 and IPv6

      "static": {
          "static_routes": [
              {
                  "ip_net": "20.20.20.0/24",
                  "next_hops": [
                      {
                          "ip_addr": "10.10.10.2",
                          "intf_name": "ens1"
                      }
                  ]
              }
          ]
      }
    

Operational State Overview

Check Static is enabled

Check static is listed in the enabled_protocols field.

flock@flocknet$ flockc system
"hostname": "flocknet"
"software": "Flock Networks Routing Suite"
"version": "21.0.0"
"model": "Large"
"base_os": "Linux"
"pid": 2423
"compile_mode": "Release"
"log_level": "info"
"uptime": Uptime { days: 0, hours: 0, mins: 0, secs: 19 }
"enabled_protocols": ["Static"]
flock@flocknet:~$

Show Static Overview

Shows the configured number of IPv4 and IPv6 static routes. It also shows the number of interfaces that the static component is aware of, these include both the system interfaces that are currently enabled as well as the interfaces that are not enabled in the system but are referred to by their names in the static route configuration.

flock@r01:~$ flockc static
{"ipv4":{"route_count":4},"ipv6":{"route_count":1},"intf_count":6}

Show all interfaces

Static tracks interfaces in the system. These include:

  • the interfaces that are enabled and have been assigned an interface ID by the kernel
  • the interfaces that are referred to by their names in the static routes but have not been assigned an interface ID by the kernel

Static shows the current interface state as follows:

  • the interface name
  • the interface id assigned by the kernel, if one exists
  • number of attached_routes referencing the interface

In the following example, ens4 interface has not been assigned an ID by the kernel

flock@r61:~$ flockc static -i
{"name":"ens1","id":2,"attached_routes":3}
{"name":"ens2","id":3,"attached_routes":2}
{"name":"ens3","id":4,"attached_routes":0}
{"name":"ens4","attached_routes":1}
{"name":"lo","id":1,"attached_routes":0}

Show Static prefix's

Note that this is not the System RIB. The static routes show all the routes from the configuration. For an attached route, it is only programmed in the RIB once its interface has been assigned an ID by the kernel.

Show all prefix's.

flock@r01:~$ flockc static -p --af ipv4
{"ip_net":"20.20.20.0/24"}
{"via":"10.10.10.2"}
{"ip_net":"30.30.30.0/24"}
{"intf":"ens3"}
{"ip_net":"40.40.40.0/24","admin_distance":100}
{"via":"10.10.10.2"}
{"via":"11.11.11.2"}

Show a specific prefix.

flock@r61:~$ flockc static -p 40.40.40.0/24 --af ipv4
{"ip_net":"40.40.40.0/24","nhs":[{"via":"10.10.10.2"},{"via":"20.20.20.2"}],"admin_distance":100}

ipv6 is the default AF type if the af option is not given