BGPD(8)
π BGPD π
okay bestie, welcome to the bgpd(8) manual β the Border Gateway Protocol (BGP) routing daemon. yes, it's the thing that makes the internet's giant routers talk to each other. no, it is not scary. it is actually kind of iconic. let's get into it π¦
β¨ NAME β¨
bgpd β Border Gateway Protocol (BGP) routing daemon
πΈ SYNOPSIS πΈ
bgpd [-cdnvV] [-D macro=value] [-f file]
that's it. that's the whole vibe. π
π DESCRIPTION π
so bgpd is a Border Gateway Protocol (BGP) daemon and its whole job is managing the network routing tables. its main purpose is exchanging info about "network reachability" with other BGP systems. it speaks Border Gateway Protocol, Version 4, exactly as described in RFC 4271. periodt.
BGP is an exterior gateway protocol, and it uses a multiple step decision process to find the best path. you can throw in advanced filtering to influence the route decision for traffic engineering β very main character behavior honestly. the session engine of bgpd is the one holding down the TCP session with each neighbor. updates get passed to the Route Decision Engine (RDE), where the paths get filtered and used to compute a Routing Information Base (RIB). and the parent process is responsible for keeping the RIB in sync with the kernel routing table. teamwork!! π«Ά
π the route decision process π
so the route decision process picks the best path by evaluating all paths to the same destination. if paths have equal attributes, it just keeps going down the steps. paths that are less preferred get taken out of consideration until only one path is left standing. survivor-style. it's giving elimination round π
- all paths with errors or loops are not eligible.
- paths with an unreachable nexthop are not eligible. after this step all remaining paths are valid.
- the path with the highest
LOCAL_PREFis selected. - the path with the shortest AS path attribute is selected.
- the
ORIGINattribute is compared. the order isIGPbeforeEGPbefore incomplete origins. - the path with the lowest
MULTI_EXIT_DISCmetric is selected. normally this value is only considered when choosing between multiple routes sent by the same neighbouring AS. however, ifrde med compare alwaysis set in the configuration, the metric is compared for routes sent by any AS. - comparison of the BGP session type. paths learned over an external (EBGP) session are preferred over those learned via an internal (IBGP) session.
- the path with the highest local weight is selected.
- if
rde route-age evaluateis set then the oldest path is selected. - the path coming from the neighbor with the lowest BGP ID wins. if the
ORIGINATOR_IDattribute is present, that value will be used in the comparison instead. - the path with the shortest
CLUSTER_LISTattribute is selected. if it is not present then a length of0is used in the comparison. - 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. you do this by changing the localpref, med, or weight attributes. and if you wanna influence the routing behaviour on remote systems? AS path prepending, or changing the med or origin attribute. chef's kiss π₯
π§ boot time shenanigans π§
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). and a running bgpd process can be controlled using the bgpctl(8) utility. bestie behavior fr fr.
β¨ OPTIONS β¨
the options are as follows:
-cβ forcebgpdto docarp(4)demotion at startup when the demote functionality is used. normally,bgpdwill only do demotion at startup when the demotion counter for the group in question is already greater than0.bgpdwill 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 groupcarpincreased until afterbgpdis started, so this option should not be used inrc.conf(8).-Dmacro=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,bgpdwill run in the foreground and log tostderr.-ffile β 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β defaultbgpdconfiguration file./run/bgpd/bgpd.sock.<rdomain>β defaultbgpdcontrol socket, where<rdomain>is the routing domain in whichbgpdhas been started.
π SEE ALSO π
mpe(4), rdomain(4), route(4), bgpd.conf(5), bgpctl(8), bgplg(8), bgplgd(8), bgplgsh(8), ospf6d(8), ospfd(8), route(8), rpki-client(8), rtrctl(8), rtrd(8)
go read them. iykyk π
β STANDARDS β
not me dropping the entire RFC reading list, but here we are, bestie β bgpd is out here complying with all of these:
- BGP Communities Attribute, RFC 1997, August 1996.
- Protection of BGP Sessions via the TCP MD5 Signature Option, RFC 2385, August 1998.
- Use of BGP-4 Multiprotocol Extensions for IPv6 Inter-Domain Routing, RFC 2545, March 1999.
- Route Refresh Capability for BGP-4, RFC 2918, September 2000.
- NOPEER Community for Border Gateway Protocol (BGP) Route Scope Control, RFC 3765, April 2004.
- A Border Gateway Protocol 4 (BGP-4), RFC 4271, January 2006.
- BGP Extended Communities Attribute, RFC 4360, February 2006.
- BGP/MPLS IP Virtual Private Networks (VPNs), RFC 4364, February 2006.
- BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP), RFC 4456, April 2006.
- Subcodes for BGP Cease Notification Message, RFC 4486, April 2006.
- Graceful Restart Mechanism for BGP, RFC 4724, January 2007.
- Multiprotocol Extensions for BGP-4, RFC 4760, January 2007.
- The Generalized TTL Security Mechanism (GTSM), RFC 5082, October 2007.
- Capabilities Advertisement with BGP-4, RFC 5492, February 2009.
- 4-Octet AS Specific BGP Extended Community, RFC 5668, October 2009.
- Autonomous-System-Wide Unique BGP Identifier for BGP-4, RFC 6286, June 2011.
- BGP Support for Four-Octet Autonomous System (AS) Number Space, RFC 6793, Dec 2012.
- Revised Error Handling for BGP UPDATE Messages, RFC 7606, August 2015.
- Multi-Threaded Routing Toolkit (MRT) Routing Information Export Format, RFC 6396, October 2011.
- Subcodes for BGP Finite State Machine Error, RFC 6608, May 2012.
- Enhanced Route Refresh Capability for BGP-4, RFC 7313, July 2014.
- Codification of AS 0 Processing, RFC 7607, August 2015.
- Advertisement of Multiple Paths in BGP, RFC 7911, July 2016.
- Internet Exchange BGP Route Server, RFC 7947, September 2016.
- Multi-Threaded Routing Toolkit (MRT) Routing Information Export Format with BGP Additional Path Extensions, RFC 8050, May 2017.
- BGP Large Communities Attribute, RFC 8092, February 2017.
- BGP Prefix Origin Validation State Extended Community, RFC 8097, March 2017.
- BGP Administrative Shutdown Communication, RFC 8203, July 2017.
- The Resource Public Key Infrastructure (RPKI) to Router Protocol, Version 1, RFC 8210, September 2017.
- Default External BGP (EBGP) Route Propagation Behavior without Policies, RFC 8212, July 2017.
- Graceful BGP Session Shutdown, RFC 8326, March 2018.
- Notification Message Support for BGP Graceful Restart, RFC 8538, March 2019.
- Extended Message Support for BGP, RFC 8654, October 2019.
- Advertising IPv4 Network Layer Reachability Information (NLRI) with an IPv6 Next Hop, RFC 8950, November 2020.
- Dissemination of Flow Specification Rules, RFC 8955, December 2020.
- Dissemination of Flow Specification Rules for IPv6, RFC 8956, December 2020.
- Extended Optional Parameters Length for BGP OPEN Message, RFC 9072, July 2021.
- Route Leak Prevention and Detection Using Roles in UPDATE and OPEN Messages, RFC 9234, May 2022.
- Border Gateway Protocol 4 (BGP-4) Send Hold Timer, RFC 9687, November 2024.
- Deprecation of AS_SET and AS_CONFED_SET in BGP, RFC 9774, May 2025.
- BGP AS_PATH Verification Based on Resource Public Key Infrastructure (RPKI) Autonomous System Provider Authorization (ASPA) Objects, draft-ietf-sidrops-aspa-verification, October 2022.
seriously, if you read all of those you deserve a lil treat π
π¦ HISTORY π¦
the bgpd program first appeared in OpenBSD 3.5. a true legend, no cap π
and that's the whole page, bestie!! this one came from the Debian fam, dated September 21, 2026, and it lives in the System Manager's Manual as BGPD(8). go configure something beautiful. mwah π
πβ¨
π¦ where this page comes from
- epel 10: openbgpd 9.3-1.el10_3 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- epel 9: openbgpd 9.3-1.el9 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- fedora 43: openbgpd 9.3-1.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- fedora 44: openbgpd 9.3-1.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms