summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/bgpd.8
blob: 8aecc78054e947b9570f3c5ae823db7dfa89b062 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
.\" $OpenBSD: bgpd.8,v 1.44 2012/07/07 12:29:18 jmc Exp $
.\"
.\" Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: July 7 2012 $
.Dt BGPD 8
.Os
.Sh NAME
.Nm bgpd
.Nd "Border Gateway Protocol daemon"
.Sh SYNOPSIS
.Nm bgpd
.Bk -words
.Op Fl cdnv
.Op Fl D Ar macro Ns = Ns Ar value
.Op Fl f Ar file
.Ek
.Sh DESCRIPTION
.Nm
is a Border Gateway Protocol
.Pq BGP
daemon which manages the network routing tables.
Its main purpose is to exchange information
concerning
.Qq network reachability
with other BGP systems.
.Nm
uses the Border Gateway Protocol, Version 4,
as described in RFC 4271.
.Pp
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
.Nm
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.
.Pp
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.
.Bl -enum -width 42 -offset bula
.It
All paths with errors or loops are not eligible.
.It
Paths with an unreachable nexthop are not eligible.
After this step all remaining paths are valid.
.It
The path with the highest
.Em LOCAL_PREF
is selected.
.It
The path with the shortest
.Em AS path
attribute is selected.
.It
The
.Em ORIGIN
attribute is compared.
The order is IGP before EGP before incomplete origins.
.It
The path with the lowest
.Em 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
.Dq Li rde med compare always
is set in the configuration, the metric is compared for routes sent by any AS.
.It
Comparison of the BGP session type.
Paths learned over an external (EBGP) session are preferred over those
learned via an internal (IBGP) session.
.It
The path with the lowest local
.Em weight
is selected.
.It
If
.Dq Li rde route-age evaluate
is set then the oldest path is selected.
.It
The path coming from the neighbor with the lowest
.Em BGP ID
wins.
If the
.Em ORIGINATOR_ID
attribute is present that value will be used in the comparison instead.
.It
The path with the shortest
.Em CLUSTER_LIST
attribute is selected.
If it is not present then a length of 0 is used in the comparison.
.It
The path coming from the peer with the lowest IP address is selected.
IPv4 sessions will be preferred over IPv6 ones.
.It
In case of locally announced prefixes
.Nm
will prefer statically set prefixes over dynamically inserted ones.
.El
.Pp
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
.Em localpref ,
.Em med ,
or
.Em weight
attributes.
AS path prepending or changing the
.Em med
or
.Em origin
attribute can be used to influencing the routing behaviour on remote systems.
.Pp
.Nm
is usually started at boot time, and can be enabled by
setting the following in
.Pa /etc/rc.conf.local :
.Pp
.Dl bgpd_flags=\&"\&"
.Pp
See
.Xr rc 8
and
.Xr rc.conf 8
for more information on the boot process
and enabling daemons.
.Pp
When
.Nm
starts up, it reads settings from a configuration file,
typically
.Xr bgpd.conf 5 .
A running
.Nm
process can be controlled using the
.Xr bgpctl 8
utility.
.Pp
The options are as follows:
.Bl -tag -width "-f fileXXX"
.It Fl c
Force
.Nm
to do
.Xr carp 4
demotion at startup when the
.Em demote
functionality is used.
Normally,
.Nm
will only do demotion at startup when the demotion counter for the group
in question is already greater than 0.
.Nm
will start handling demotion after all sessions with demotion configured for
the given group have been successfully established.
At system startup,
.Xr rc 8
has the demotion counter for the group
.Em carp
increased until after
.Nm
is started, so this option should
.Em not
be used in
.Xr rc.conf 8 .
.It Fl D Ar macro Ns = Ns Ar value
Define
.Ar macro
to be set to
.Ar value
on the command line.
Overrides the definition of
.Ar macro
in the configuration file.
.It Fl d
Do not daemonize.
If this option is specified,
.Nm
will run in the foreground and log to
.Em stderr .
.It Fl f Ar file
Use
.Ar file
as the configuration file,
instead of the default
.Pa /etc/bgpd.conf .
.It Fl n
Configtest mode.
Only check the configuration file for validity.
.It Fl v
Produce more verbose output.
.El
.Sh FILES
.Bl -tag -width "/var/run/bgpd.sockXXX" -compact
.It Pa /etc/bgpd.conf
default
.Nm
configuration file
.It Pa /var/run/bgpd.sock
default
.Nm
control socket
.El
.Sh SEE ALSO
.Xr bgpd.conf 5 ,
.Xr bgpctl 8 ,
.Xr bgplg 8 ,
.Xr bgplgsh 8
.Rs
.%R RFC 4271
.%T "A Border Gateway Protocol 4 (BGP-4)"
.%D January 2006
.Re
.Rs
.%R RFC 1997
.%T "BGP Communities Attribute"
.%D August 1996
.Re
.Rs
.%R RFC 2385
.%T "Protection of BGP Sessions via the TCP MD5 Signature Option"
.%D August 1998
.Re
.Rs
.%R RFC 2545
.%T "Use of BGP-4 Multiprotocol Extensions for IPv6 Inter-Domain Routing"
.%D March 1999
.Re
.Rs
.%R RFC 2918
.%T "Route Refresh Capability for BGP-4"
.%D September 2000
.Re
.Rs
.%R RFC 3682
.%T "The Generalized TTL Security Mechanism (GTSM)"
.%D February 2004
.Re
.Rs
.%R RFC 3765
.%T "NOPEER Community for Border Gateway Protocol"
.%D April 2004
.Re
.Rs
.%R RFC 4360
.%T "BGP Extended Communities Attribute"
.%D February 2006
.Re
.Rs
.%R RFC 4364
.%T "BGP/MPLS IP Virtual Private Networks (VPNs)"
.%D February 2006
.Re
.Rs
.%R RFC 4456
.%T "BGP Route Reflection - An Alternative to Full Mesh IBGP"
.%D April 2006
.Re
.Rs
.%R RFC 4486
.%T "BGP Cease Notification Message Subcodes"
.%D April 2006
.Re
.Rs
.%R RFC 4760
.%T "Multiprotocol Extensions for BGP-4"
.%D January 2007
.Re
.Rs
.%R RFC 4893
.%T "BGP Support for Four-octet AS Number Space"
.%D May 2007
.Re
.Rs
.%R RFC 5492
.%T "Capabilities Advertisement with BGP-4"
.%D February 2009
.Re
.Rs
.%R draft-ietf-idr-optional-transitive-00
.%T "Error Handling for Optional Transitive BGP Attributes"
.%D April 2009
.Re
.Rs
.%R RFC 6608
.%T "Subcodes for BGP Finite State Machine Error"
.%D May 2012
.Re
.Rs
.%R draft-ietf-grow-mrt-17
.%T "MRT routing information export format"
.%D August 2011
.Re
.Sh HISTORY
The
.Nm
program first appeared in
.Ox 3.5 .