1BGPD(8)                   BSD System Manager's Manual                  BGPD(8)
2

NAME

4     bgpd — Border Gateway Protocol daemon
5

SYNOPSIS

7     bgpd [-cdnv] [-D macro=value] [-f file]
8

DESCRIPTION

10     bgpd is a Border Gateway Protocol (BGP) daemon which manages the network
11     routing tables.  Its main purpose is to exchange information concerning
12     "network reachability" with other BGP systems.  bgpd uses the Border
13     Gateway Protocol, Version 4, as described in RFC 4271.
14
15     BGP is an exterior gateway protocol using a multiple step decision
16     process to find the best path.  Advanced filtering can be used to influ‐
17     ence the route decision for traffic engineering.  The session engine of
18     bgpd is responsible for maintaining the TCP session with each neighbor.
19     Updates are passed to the Route Decision Engine (RDE) where the paths are
20     filtered and used to compute a Routing Information Base (RIB).  The par‐
21     ent process is responsible for keeping the RIB in sync with the kernel
22     routing table.
23
24     The route decision process selects the best path by evaluating all paths
25     to the same destination.  The decision process continues to the next step
26     if paths have equal attributes.  Paths that are less preferred are taken
27     out of consideration until there is only one path left.
28
29         1.  All paths with errors or loops are not eligible.
30
31         2.  Paths with an unreachable nexthop are not eligible.  After this
32             step all remaining paths are valid.
33
34         3.  The path with the highest LOCAL_PREF is selected.
35
36         4.  The path with the shortest AS path attribute is selected.
37
38         5.  The ORIGIN attribute is compared.  The order is IGP before EGP
39             before incomplete origins.
40
41         6.  The path with the lowest MULTI_EXIT_DISC metric is selected.
42             Normally, this value is only considered when choosing between
43             multiple routes sent by the same neighbouring AS.  However, if
44             “rde med compare always” is set in the configuration, the metric
45             is compared for routes sent by any AS.
46
47         7.  Comparison of the BGP session type.  Paths learned over an exter‐
48             nal (EBGP) session are preferred over those learned via an inter‐
49             nal (IBGP) session.
50
51         8.  The path with the highest local weight is selected.
52
53         9.  If “rde route-age evaluate” is set then the oldest path is se‐
54             lected.
55
56         10. The path coming from the neighbor with the lowest BGP ID wins.
57             If the ORIGINATOR_ID attribute is present that value will be used
58             in the comparison instead.
59
60         11. The path with the shortest CLUSTER_LIST attribute is selected.
61             If it is not present then a length of 0 is used in the compari‐
62             son.
63
64         12. The path coming from the peer with the lowest IP address is se‐
65             lected.  IPv4 sessions will be preferred over IPv6 ones.
66
67     Attributes set by filters can be used to tip the decision process to pre‐
68     fer particular paths over others.  This can be achieved by changing the
69     localpref, med, or weight attributes.  AS path prepending or changing the
70     med or origin attribute can be used to influence the routing behaviour on
71     remote systems.
72
73     To have bgpd enabled at boot time, use “rcctl enable bgpd”, which sets
74
75           bgpd_flags=""
76
77     in rc.conf.local(8).
78
79     When bgpd starts up, it reads settings from a configuration file, typi‐
80     cally bgpd.conf(5).  A running bgpd process can be controlled using the
81     bgpctl(8) utility.
82
83     The options are as follows:
84
85     -c          Force bgpd to do carp(4) demotion at startup when the demote
86                 functionality is used.  Normally, bgpd will only do demotion
87                 at startup when the demotion counter for the group in ques‐
88                 tion is already greater than 0.  bgpd will start handling de‐
89                 motion after all sessions with demotion configured for the
90                 given group have been successfully established.  At system
91                 startup, rc(8) has the demotion counter for the group carp
92                 increased until after bgpd is started, so this option should
93                 not be used in rc.conf(8).
94
95     -D macro=value
96                 Define macro to be set to value on the command line.  Over‐
97                 rides the definition of macro in the configuration file.
98
99     -d          Do not daemonize.  If this option is specified, bgpd will run
100                 in the foreground and log to stderr.
101
102     -f file     Use file as the configuration file, instead of the default
103                 /etc/bgpd.conf.
104
105     -n          Configtest mode.  Only check the configuration file for va‐
106                 lidity.
107
108     -v          Produce more verbose output.
109

FILES

111     /etc/bgpd.conf                 Default bgpd configuration file.
112     /run/bgpd/bgpd.sock.<rdomain>  Default bgpd control socket, where
113                                    <rdomain> is the routing domain in which
114                                    bgpd has been started.
115

SEE ALSO

117     bgpd.conf(5), bgpctl(8), bgplg(8), bgplgsh(8)
118

STANDARDS

120     R. Chandra, P. Traina, and T. Li, BGP Communities Attribute, RFC 1997,
121     August 1996.
122
123     A. Heffernan, Protection of BGP Sessions via the TCP MD5 Signature
124     Option, RFC 2385, August 1998.
125
126     P. Marques and F. Dupont, Use of BGP-4 Multiprotocol Extensions for IPv6
127     Inter-Domain Routing, RFC 2545, March 1999.
128
129     E. Chen, Route Refresh Capability for BGP-4, RFC 2918, September 2000.
130
131     G. Huston, NOPEER Community for Border Gateway Protocol (BGP) Route Scope
132     Control, RFC 3765, April 2004.
133
134     Y. Rekhter, T. Li, and S. Hares, A Border Gateway Protocol 4 (BGP-4), RFC
135     4271, January 2006.
136
137     S. Sangli, D. Tappan, and Y. Rekhter, BGP Extended Communities Attribute,
138     RFC 4360, February 2006.
139
140     E. Rosen and Y. Rekhter, BGP/MPLS IP Virtual Private Networks (VPNs), RFC
141     4364, February 2006.
142
143     T. Bates, E. Chen, and R. Chandra, BGP Route Reflection: An Alternative
144     to Full Mesh Internal BGP (IBGP), RFC 4456, April 2006.
145
146     E. Chen and V. Gillet, Subcodes for BGP Cease Notification Message, RFC
147     4486, April 2006.
148
149     T. Bates, R. Chandra, D. Katz, and Y. Rekhter, Multiprotocol Extensions
150     for BGP-4, RFC 4760, January 2007.
151
152     Q. Vohra and E. Chen, BGP Support for Four-octet AS Number Space, RFC
153     4893, May 2007.
154
155     V. Gill, J. Heasley, D. Meyer, P. Savola, and C. Pignatoro, The
156     Generalized TTL Security Mechanism (GTSM), RFC 5082, October 2007.
157
158     J. Scudder and R. Chandra, Capabilities Advertisement with BGP-4, RFC
159     5492, February 2009.
160
161     E. Chen, J. Scudder, P. Mohapatra, and K. Patel, Revised Error Handling
162     for BGP UPDATE Messages, RFC 7606, August 2015.
163
164     L. Blunk, M. Karir, and C. Labovitz, Multi-Threaded Routing Toolkit (MRT)
165     Routing Information Export Format, RFC 6396, October 2011.
166
167     J. Dong, M. Chen, and A. Suryanarayana, Subcodes for BGP Finite State
168     Machine Error, RFC 6608, May 2012.
169
170     W. Kumari, R. Bush, H. Schiller, and K. Patel, Codification of AS 0
171     Processing, RFC 7607, August 2015.
172
173     J. Heitz, J. Snijders, K. Patel, I. Bagdonas, and N. Hilliard, BGP Large
174     Communities Attribute, RFC 8092, February 2017.
175
176     P. Mohapatra, K. Patel, J. Scudder, D. Ward, and R. Bush, BGP Prefix
177     Origin Validation State Extended Community, RFC 8097, March 2017.
178
179     J. Snijders, J. Heitz, and J. Scudder, BGP Administrative Shutdown
180     Communication, RFC 8203, July 2017.
181
182     R. Bush and R. Austein, The Resource Public Key Infrastructure (RPKI) to
183     Router Protocol, Version 1, RFC 8210, September 2017.
184
185     J. Mauch, J. Snijders, and G. Hankins, Default External BGP (EBGP) Route
186     Propagation Behavior without Policies, RFC 8212, July 2017.
187
188     P. Francois, B. Decraene, C. Pelsser, K. Patel, and C. Filsfils, Graceful
189     BGP Session Shutdown, RFC 8326, March 2018.
190

HISTORY

192     The bgpd program first appeared in OpenBSD 3.5.
193
194BSD                              April 8, 2021                             BSD
Impressum