BGPv4 Component

Configuration Overview

/etc/flockd/bgpv4.toml is the configuration file. If this file exists BGPv4 is enabled, otherwise BGPv4 remains disabled. The default flockd debian package install will not create this file, so BGPv4 will not be enabled as part of the install. During the package install, an example configuration file is copied to /etc/flockd/bgpv4.toml.example.

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

      id = "" # BGP ID of this router
      as_id = 65016 # Autonomous System this router is part of
      # Originate networks into BGP
      ip_prefix = ""
      # iBGP neighbors (as_id == local.as_id)
      as_id = 65016
      # Allow iBGP neighbors to not have eBGP subnets in their IPv4 RIB
      next_hop_self = true
      ip = ""
      local_ip = ""
      # AS65017 eBGP neighbors (as_id != local.as_id)
      as_id = 65017
      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.2.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