BGPv4 Configuration

All Flock Network configuration files are in the toml format. If the configuration file exists the protocol is enabled, otherwise it remains disabled.

Example /etc/flockd/bgpv4.toml

[local]
id = "172.16.10.1" # BGP ID of this router
as_id = 65016 # Autonomous System this router is part of
# Originate networks into BGP
[[local.network]]
ip_prefix = "172.16.0.0/16"
[[local.network]]
ip_prefix = "172.17.0.0/16"

# iBGP neighbors (as_id == local.as_id)
[[as]]
as_id = 65016
# Allow iBGP neighbors to not have eBGP subnets in their IPv4 RIB
next_hop_self = true
[[as.neighbor]]
ip = "172.16.10.2"
local_ip = "172.16.10.1"
# Set non-default timers for this neighbor
[[as.neighbor]]
ip = "172.16.10.3"
local_ip = "172.16.10.1"
[as.neighbor.timers]
keep_alive = 30
hold_time = 90

# AS65017 eBGP neighbors (as_id != local.as_id)
[[as]]
as_id = 65017
[[as.neighbor]]
ip = "172.17.20.1"
[[as.neighbor]]
ip = "172.17.30.1"

BGPv4 Active / Passive Neighbors

By default BGPv4 will try to create two TCP transport connections to each neighbor. One outgoing to the neighbors remote BGP TCP port 179, and one allowing incoming connections from the neighbor to the local BGP TCP port 179. A tie break is used to enusure only one connection remains when the BGP neighbor moves to the 'Established' state.

The router can be configured to only form a single TCP transport connection to each neighbor using the connect_mode neighbor configuration parameter.

# Only create the outgoing connection to this neighbor, refuse any incoming connection.
[[as.neighbor]]
connect_mode = "active"

or

# Only allow the incoming connection from this neighbor, do not create any outgoing connection.
[[as.neighbor]]
connect_mode = "passive"

BGPv4 Route Reflectors

To configure a router as a BGP Route Reflector, specify which neighbors are Route Relector clients using the route_reflector_client configuration boolean.

# Reflect iBGP routes to and from neighbor 172.16.10.2
[[as.neighbor]]
ip = "172.16.10.2"
route_reflector_client = true

# Do not reflect iBGP routes to or from neighbor 172.16.10.3
# Route reflection is off by default.
[[as.neighbor]]
ip = "172.16.10.3"

To deploy redundant Route Reflectors a Route Relector Cluster Id can optionally be configured.

[local]
cluster_id = "1.2.3.4"