BGPD(8)

NAME
bgpd - Border Gateway Protocol (BGP) routing daemon

SYNOPSIS
bgpd [-cdnvV] [-D macro=value] [-f file]

DESCRIPTION
bgpd is a Border Gateway Protocol (BGP) daemon which manages the network routing tables. Its main purpose is to exchange information concerning "network reachability" with other BGP systems. bgpd uses the Border Gateway Protocol, Version 4, as described in RFC 4271.

BGP is an exterior gateway protocol using a multiple step decision process to find the best path. Advanced filtering can be used to influence the route decision for traffic engineering. The session engine of bgpd is responsible for maintaining the TCP session with each neighbor. Updates are passed to the Route Decision Engine (RDE) where the paths are filtered and used to compute a Routing Information Base (RIB). The parent process is responsible for keeping the RIB in sync with the kernel routing table.

The route decision process selects the best path by evaluating all paths to the same destination. The decision process continues to the next step if paths have equal attributes. Paths that are less preferred are taken out of consideration until there is only one path left.

1.  All paths with errors or loops are not eligible.

2.  Paths with an unreachable nexthop are not eligible. After this step all remaining paths are valid.

3.  The path with the highest LOCAL_PREF is selected.

4.  The path with the shortest AS path attribute is selected.

5.  The ORIGIN attribute is compared. The order is IGP before EGP before incomplete origins.

6.  The path with the lowest MULTI_EXIT_DISC metric is selected. Normally, this value is only considered when choosing between multiple routes sent by the same neighbouring AS. However, if “rde med compare always” is set in the configuration, the metric is compared for routes sent by any AS.

7.  Comparison of the BGP session type. Paths learned over an external (EBGP) session are preferred over those learned via an internal (IBGP) session.

8.  The path with the highest local weight is selected.

9.  If “rde route-age evaluate” is set then the oldest path is selected.

10. The path coming from the neighbor with the lowest BGP ID wins. If the ORIGINATOR_ID attribute is present, that value will be used in the comparison instead.

11. The path with the shortest CLUSTER_LIST attribute is selected. If it is not present then a length of 0 is used in the comparison.

12. The path coming from the peer with the lowest IP address is selected. IPv4 sessions will be preferred over IPv6 ones.

Attributes set by filters can be used to tip the decision process to prefer particular paths over others. This can be achieved by changing the localpref, med, or weight attributes. AS path prepending or changing the med or origin attribute can be used to influence the routing behaviour on remote systems.

To have bgpd enabled at boot time, use “rcctl enable bgpd”, which sets

    bgpd_flags=""

in rc.conf.local(8).

When bgpd starts up, it reads settings from a configuration file, typically bgpd.conf(5). A running bgpd process can be controlled using the bgpctl(8) utility.

The options are as follows:

-c  Force bgpd to do carp(4) demotion at startup when the demote functionality is used. Normally, bgpd will only do demotion at startup when the demotion counter for the group in question is already greater than 0. bgpd will start handling demotion after all sessions with demotion configured for the given group have been successfully established. At system startup, rc(8) has the demotion counter for the group carp increased until after bgpd is started, so this option should not be used in rc.conf(8).

-D macro=value
    Define macro to be set to value on the command line. Overrides the definition of macro in the configuration file.

-d  Do not daemonize. If this option is specified, bgpd will run in the foreground and log to stderr.

-f file
    Use file as the configuration file, instead of the default /etc/bgpd.conf.

-n  Configtest mode. Only check the configuration file for validity.

-v  Produce more verbose output.

-V  Show the version and exit.

FILES
/etc/bgpd.conf
    Default bgpd configuration file.
/var/run/bgpd.sock.<rdomain>
    Default bgpd control socket, where <rdomain> is the routing domain in which bgpd has been started.

SEE ALSO
bgpd.conf(5), bgpctl(8), bgplg(8), bgplgsh(8)

STANDARDS
R. Chandra, P. Traina, T. Li, August 1996, RFC 1997, BGP Communities Attribute.

A. Heffernan, August 1998, RFC 2385, Protection of BGP Sessions via the TCP MD5 Signature Option.

P. Marques, F. Dupont, March 1999, RFC 2545, Use of BGP-4 Multiprotocol Extensions for IPv6 Inter-Domain Routing.

E. Chen, September 2000, RFC 2918, Route Refresh Capability for BGP-4.

G. Huston, April 2004, RFC 3765, NOPEER Community for Border Gateway Protocol (BGP) Route Scope Control.

Y. Rekhter, T. Li, S. Hares, January 2006, RFC 4271, A Border Gateway Protocol 4 (BGP-4).

S. Sangli, D. Tappan, Y. Rekhter, February 2006, RFC 4360, BGP Extended Communities Attribute.

E. Rosen, Y. Rekhter, February 2006, RFC 4364, BGP/MPLS IP Virtual Private Networks (VPNs).

T. Bates, E. Chen, R. Chandra, April 2006, RFC 4456, BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP).

E. Chen, V. Gillet, April 2006, RFC 4486, Subcodes for BGP Cease Notification Message.

T. Bates, R. Chandra, D. Katz, Y. Rekhter, January 2007, RFC 4760, Multiprotocol Extensions for BGP-4.

V. Gill, J. Heasley, D. Meyer, P. Savola, C. Pignataro, October 2007, RFC 5082, The Generalized TTL Security Mechanism (GTSM).

J. Scudder, R. Chandra, February 2009, RFC 5492, Capabilities Advertisement with BGP-4.

E. Chen, J. Yuan, June 2011, RFC 6286, Autonomous-System-Wide Unique BGP Identifier for BGP-4.

Q. Vohra, E. Chen, Dec 2012, RFC 6793, BGP Support for Four-Octet Autonomous System (AS) Number Space.

E. Chen, J. Scudder, P. Mohapatra, K. Patel, August 2015, RFC 7606, Revised Error Handling for BGP UPDATE Messages.

L. Blunk, M. Karir, C. Labovitz, October 2011, RFC 6396, Multi-Threaded Routing Toolkit (MRT) Routing Information Export Format.

J. Dong, M. Chen, A. Suryanarayana, May 2012, RFC 6608, Subcodes for BGP Finite State Machine Error.

K. Patel, E. Chen, B. Venkatachalapathy, July 2014, RFC 7313, Enhanced Route Refresh Capability for BGP-4.

W. Kumari, R. Bush, H. Schiller, K. Patel, August 2015, RFC 7607, Codification of AS 0 Processing.

D. Walton, A. Retana, E. Chen, J. Scudder, July 2016, RFC 7911, Advertisement of Multiple Paths in BGP.

C. Petrie, T. King, May 2017, RFC 8050, Multi-Threaded Routing Toolkit (MRT) Routing Information Export Format with BGP Additional Path Extensions.

J. Heitz, J. Snijders, K. Patel, I. Bagdonas, N. Hilliard, February 2017, RFC 8092, BGP Large Communities Attribute.

P. Mohapatra, K. Patel, J. Scudder, D. Ward, R. Bush, March 2017, RFC 8097, BGP Prefix Origin Validation State Extended Community.

J. Snijders, J. Heitz, J. Scudder, July 2017, RFC 8203, BGP Administrative Shutdown Communication.

R. Bush, R. Austein, September 2017, RFC 8210, The Resource Public Key Infrastructure (RPKI) to Router Protocol, Version 1.

J. Mauch, J. Snijders, G. Hankins, July 2017, RFC 8212, Default External BGP (EBGP) Route Propagation Behavior without Policies.

P. Francois, B. Decraene, C. Pelsser, K. Patel, C. Filsfils, March 2018, RFC 8326, Graceful BGP Session Shutdown.

C. Loibl, S. Hares, R. Raszuk, D. McPherson, M. Bacher, December 2020, RFC 8955, Dissemination of Flow Specification Rules.

C. Loibl, R. Raszuk, S. Hares, December 2020, RFC 8956, Dissemination of Flow Specification Rules for IPv6.

E. Chen, J. Scudder, July 2021, RFC 9072, Extended Optional Parameters Length for BGP OPEN Message.

A. Azimov, E. Bogomazov, R. Bush, K. Patel, K. Sriram, May 2022, RFC 9234, Route Leak Prevention and Detection Using Roles in UPDATE and OPEN Messages.

A. Azimov, E. Bogomazov, R. Bush, K. Patel, J. Snijders, K. Sriram, October 2022, draft-ietf-sidrops-aspa-verification, BGP AS_PATH Verification Based on Resource Public Key Infrastructure (RPKI) Autonomous System Provider Authorization (ASPA) Objects.

HISTORY
The bgpd program first appeared in OpenBSD 3.5.