BGPv4 Component

Configuration Overview

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

In the minimal configuration file below;

  • The router is in AS 65016 with a BGP router id of

  • The router originates the network

  • The router has a single iBGP neighbor

    • The iBGP connection source is
    • Routes are advertised over iBGP with a next hop of (next_hop_self)
  • The router has a single eBGP neighbor in remote AS 65017

      "bgp": {
          "local": {
              "id": "",
              "asn": 65016,
              "network": [
                  "ip_prefix": ""
          "as": [
              "asn": 65016,
              "next_hop_self": true,
              "neighbor": [
                  "ip": "",
                  "local_ip": ""
              "asn": 65017,
              "neighbor": [
                  "ip": ""

Operational State Overview

Check BGPv4 is enabled

Check BGPv4 is listed in the enabled_protocols field.

flock@flocknet$ flockc system
"hostname": "flocknet"
"software": "Flock Networks Routing Suite"
"version": "20.4.0"
"model": "Multi-threaded"
"pid": 2423
"compile_mode": "Release"
"log_level": "info"
"uptime": Uptime { days: 0, hours: 0, mins: 0, secs: 19 }
"enabled_protocols": ["BGPv4"]

Show BGPv4 Overview

flock@r01:~$ flockc bgp

Show all neighbors (in all Autonomous Systems)

BGPv4 runs two Finite State Machines (FSM's) per neighbor. One FSM handles the Outgoing TCP connection and the other handles the Incoming TCP connection. The Flock Routing Suite does not hide this from the operator. In the final working state each neighbor should have one FSM in the Established state, and one FSM in the Idle state.

The last error to cause a BGP Notify Message is held in each FSM's last_notify field. This field is never cleared, it is only overwritten with the last error. So a value of null means there have been no errors that have caused a notify message since flockd was started.

flock@r61:~$ flockc bgp -n

Show BGPv4 RIB prefix's

Note that this is not the System RIB. The BGPv4 RIB records routes from all neighbors and sends the 'best entry' route to the System RIB.

Show all prefix's. Only the 'best entry' for each prefix is shown, along with the reason why it was the best.

flock@r01:~$ flockc bgp -p

Show a specific prefix. The 'best entry' and all the candidate entries are shown.

flock@r61:~$ flockc bgp -p