blob: de709707a7d5de86d3e0e435e150ffba45bafb9f [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001@c -*-texinfo-*-
paul7190f4e2003-08-12 12:40:20 +00002@c This is part of the Quagga Manual.
paul76b89b42004-11-06 17:13:09 +00003@c @value{COPYRIGHT_STR}
4@c See file quagga.texi for copying conditions.
paul718e3742002-12-13 20:15:29 +00005@node BGP
paul718e3742002-12-13 20:15:29 +00006@chapter BGP
7
paulaa5943f2005-11-04 21:53:59 +00008@acronym{BGP} stands for a Border Gateway Protocol. The lastest BGP version
paul718e3742002-12-13 20:15:29 +00009is 4. It is referred as BGP-4. BGP-4 is one of the Exterior Gateway
10Protocols and de-fact standard of Inter Domain routing protocol.
paulaa5943f2005-11-04 21:53:59 +000011BGP-4 is described in @cite{RFC1771, A Border Gateway Protocol
paul718e3742002-12-13 20:15:29 +0000124 (BGP-4)}.
13
paulaa5943f2005-11-04 21:53:59 +000014Many extensions have been added to @cite{RFC1771}. @cite{RFC2858,
15Multiprotocol Extensions for BGP-4} provides multiprotocol support to
16BGP-4.
paul718e3742002-12-13 20:15:29 +000017
18@menu
19* Starting BGP::
20* BGP router::
21* BGP network::
22* BGP Peer::
23* BGP Peer Group::
24* BGP Address Family::
25* Autonomous System::
26* BGP Communities Attribute::
27* BGP Extended Communities Attribute::
28* Displaying BGP routes::
29* Capability Negotiation::
30* Route Reflector::
31* Route Server::
32* How to set up a 6-Bone connection::
33* Dump BGP packets and table::
paulaa5943f2005-11-04 21:53:59 +000034* BGP Configuration Examples::
paul718e3742002-12-13 20:15:29 +000035@end menu
36
paul76b89b42004-11-06 17:13:09 +000037@node Starting BGP
paul718e3742002-12-13 20:15:29 +000038@section Starting BGP
39
40Default configuration file of @command{bgpd} is @file{bgpd.conf}.
41@command{bgpd} searches the current directory first then
42@value{INSTALL_PREFIX_ETC}/bgpd.conf. All of bgpd's command must be
43configured in @file{bgpd.conf}.
44
45@command{bgpd} specific invocation options are described below. Common
46options may also be specified (@pxref{Common Invocation Options}).
47
48@table @samp
49@item -p @var{PORT}
50@itemx --bgp_port=@var{PORT}
51Set the bgp protocol's port number.
52
53@item -r
54@itemx --retain
55When program terminates, retain BGP routes added by zebra.
56@end table
57
paul76b89b42004-11-06 17:13:09 +000058@node BGP router
paul718e3742002-12-13 20:15:29 +000059@section BGP router
60
61 First of all you must configure BGP router with @command{router bgp}
62command. To configure BGP router, you need AS number. AS number is an
63identification of autonomous system. BGP protocol uses the AS number
64for detecting whether the BGP connection is internal one or external one.
65
66@deffn Command {router bgp @var{asn}} {}
67Enable a BGP protocol process with the specified @var{asn}. After
68this statement you can input any @code{BGP Commands}. You can not
69create different BGP process under different @var{asn} without
70specifying @code{multiple-instance} (@pxref{Multiple instance}).
71@end deffn
72
73@deffn Command {no router bgp @var{asn}} {}
74Destroy a BGP protocol process with the specified @var{asn}.
75@end deffn
76
77@deffn {BGP} {bgp router-id @var{A.B.C.D}} {}
78This command specifies the router-ID. If @command{bgpd} connects to @command{zebra} it gets
79interface and address information. In that case default router ID value
80is selected as the largest IP Address of the interfaces. When
81@code{router zebra} is not enabled @command{bgpd} can't get interface information
82so @code{router-id} is set to 0.0.0.0. So please set router-id by hand.
83@end deffn
84
85@menu
86* BGP distance::
87* BGP decision process::
Alexandre Chappuisc31e5722011-09-11 16:54:11 +040088* BGP route flap dampening::
paul718e3742002-12-13 20:15:29 +000089@end menu
90
paul76b89b42004-11-06 17:13:09 +000091@node BGP distance
paul718e3742002-12-13 20:15:29 +000092@subsection BGP distance
93
94@deffn {BGP} {distance bgp <1-255> <1-255> <1-255>} {}
95This command change distance value of BGP. Each argument is distance
96value for external routes, internal routes and local routes.
97@end deffn
98
99@deffn {BGP} {distance <1-255> @var{A.B.C.D/M}} {}
100@deffnx {BGP} {distance <1-255> @var{A.B.C.D/M} @var{word}} {}
101This command set distance value to
102@end deffn
103
paul76b89b42004-11-06 17:13:09 +0000104@node BGP decision process
paul718e3742002-12-13 20:15:29 +0000105@subsection BGP decision process
106
107@table @asis
108@item 1. Weight check
109
110@item 2. Local preference check.
111
112@item 3. Local route check.
113
114@item 4. AS path length check.
115
116@item 5. Origin check.
117
118@item 6. MED check.
119@end table
120
hasso68118452005-04-08 15:40:36 +0000121@deffn {BGP} {bgp bestpath as-path confed} {}
122This command specifies that the length of confederation path sets and
123sequences should should be taken into account during the BGP best path
124decision process.
125@end deffn
126
Pradosh Mohapatra2fdd4552013-09-07 07:02:36 +0000127@deffn {BGP} {bgp bestpath as-path multipath-relax} {}
128This command specifies that BGP decision process should consider paths
129of equal AS_PATH length candidates for multipath computation. Without
130the knob, the entire AS_PATH must match for multipath computation.
131@end deffn
132
Alexandre Chappuisc31e5722011-09-11 16:54:11 +0400133@node BGP route flap dampening
134@subsection BGP route flap dampening
135
136@deffn {BGP} {bgp dampening @var{<1-45>} @var{<1-20000>} @var{<1-20000>} @var{<1-255>}} {}
137This command enables BGP route-flap dampening and specifies dampening parameters.
138
139@table @asis
140@item @asis{half-life}
141Half-life time for the penalty
142@item @asis{reuse-threshold}
143Value to start reusing a route
144@item @asis{suppress-threshold}
145Value to start suppressing a route
146@item @asis{max-suppress}
147Maximum duration to suppress a stable route
148@end table
149
150The route-flap damping algorithm is compatible with @cite{RFC2439}. The use of this command
151is not recommended nowadays, see @uref{http://www.ripe.net/ripe/docs/ripe-378,,RIPE-378}.
152@end deffn
153
paul76b89b42004-11-06 17:13:09 +0000154@node BGP network
paul718e3742002-12-13 20:15:29 +0000155@section BGP network
156
157@menu
158* BGP route::
159* Route Aggregation::
160* Redistribute to BGP::
161@end menu
162
paul76b89b42004-11-06 17:13:09 +0000163@node BGP route
paul718e3742002-12-13 20:15:29 +0000164@subsection BGP route
165
166@deffn {BGP} {network @var{A.B.C.D/M}} {}
167This command adds the announcement network.
168@example
169@group
170router bgp 1
171 network 10.0.0.0/8
172@end group
173@end example
174This configuration example says that network 10.0.0.0/8 will be
175announced to all neighbors. Some vendors' routers don't advertise
Paul Jakma41367172007-08-06 15:24:51 +0000176routes if they aren't present in their IGP routing tables; @code{bgpd}
paul718e3742002-12-13 20:15:29 +0000177doesn't care about IGP routes when announcing its routes.
178@end deffn
179
180@deffn {BGP} {no network @var{A.B.C.D/M}} {}
181@end deffn
182
paul76b89b42004-11-06 17:13:09 +0000183@node Route Aggregation
paul718e3742002-12-13 20:15:29 +0000184@subsection Route Aggregation
185
186@deffn {BGP} {aggregate-address @var{A.B.C.D/M}} {}
187This command specifies an aggregate address.
188@end deffn
189
190@deffn {BGP} {aggregate-address @var{A.B.C.D/M} as-set} {}
191This command specifies an aggregate address. Resulting routes inlucde
192AS set.
193@end deffn
194
195@deffn {BGP} {aggregate-address @var{A.B.C.D/M} summary-only} {}
196This command specifies an aggregate address. Aggreated routes will
197not be announce.
198@end deffn
199
200@deffn {BGP} {no aggregate-address @var{A.B.C.D/M}} {}
201@end deffn
202
paul76b89b42004-11-06 17:13:09 +0000203@node Redistribute to BGP
paul718e3742002-12-13 20:15:29 +0000204@subsection Redistribute to BGP
205
206@deffn {BGP} {redistribute kernel} {}
207Redistribute kernel route to BGP process.
208@end deffn
209
210@deffn {BGP} {redistribute static} {}
211Redistribute static route to BGP process.
212@end deffn
213
214@deffn {BGP} {redistribute connected} {}
215Redistribute connected route to BGP process.
216@end deffn
217
218@deffn {BGP} {redistribute rip} {}
219Redistribute RIP route to BGP process.
220@end deffn
221
222@deffn {BGP} {redistribute ospf} {}
223Redistribute OSPF route to BGP process.
224@end deffn
225
paul76b89b42004-11-06 17:13:09 +0000226@node BGP Peer
paul718e3742002-12-13 20:15:29 +0000227@section BGP Peer
228
229@menu
230* Defining Peer::
231* BGP Peer commands::
232* Peer filtering::
233@end menu
234
paul76b89b42004-11-06 17:13:09 +0000235@node Defining Peer
paul718e3742002-12-13 20:15:29 +0000236@subsection Defining Peer
237
238@deffn {BGP} {neighbor @var{peer} remote-as @var{asn}} {}
239Creates a new neighbor whose remote-as is @var{asn}. @var{peer}
240can be an IPv4 address or an IPv6 address.
241@example
242@group
243router bgp 1
244 neighbor 10.0.0.1 remote-as 2
245@end group
246@end example
247In this case my router, in AS-1, is trying to peer with AS-2 at
24810.0.0.1.
249
250This command must be the first command used when configuring a neighbor.
251If the remote-as is not specified, @command{bgpd} will complain like this:
252@example
253can't find neighbor 10.0.0.1
254@end example
255@end deffn
256
paul76b89b42004-11-06 17:13:09 +0000257@node BGP Peer commands
paul718e3742002-12-13 20:15:29 +0000258@subsection BGP Peer commands
259
260In a @code{router bgp} clause there are neighbor specific configurations
261required.
262
263@deffn {BGP} {neighbor @var{peer} shutdown} {}
264@deffnx {BGP} {no neighbor @var{peer} shutdown} {}
265Shutdown the peer. We can delete the neighbor's configuration by
266@code{no neighbor @var{peer} remote-as @var{as-number}} but all
267configuration of the neighbor will be deleted. When you want to
268preserve the configuration, but want to drop the BGP peer, use this
269syntax.
270@end deffn
271
272@deffn {BGP} {neighbor @var{peer} ebgp-multihop} {}
273@deffnx {BGP} {no neighbor @var{peer} ebgp-multihop} {}
274@end deffn
275
276@deffn {BGP} {neighbor @var{peer} description ...} {}
277@deffnx {BGP} {no neighbor @var{peer} description ...} {}
278Set description of the peer.
279@end deffn
280
281@deffn {BGP} {neighbor @var{peer} version @var{version}} {}
282Set up the neighbor's BGP version. @var{version} can be @var{4},
283@var{4+} or @var{4-}. BGP version @var{4} is the default value used for
284BGP peering. BGP version @var{4+} means that the neighbor supports
285Multiprotocol Extensions for BGP-4. BGP version @var{4-} is similar but
286the neighbor speaks the old Internet-Draft revision 00's Multiprotocol
287Extensions for BGP-4. Some routing software is still using this
288version.
289@end deffn
290
291@deffn {BGP} {neighbor @var{peer} interface @var{ifname}} {}
292@deffnx {BGP} {no neighbor @var{peer} interface @var{ifname}} {}
Paul Jakma825cd492006-05-23 22:20:34 +0000293When you connect to a BGP peer over an IPv6 link-local address, you
294have to specify the @var{ifname} of the interface used for the
295connection. To specify IPv4 session addresses, see the
296@code{neighbor @var{peer} update-source} command below.
297
298This command is deprecated and may be removed in a future release. Its
299use should be avoided.
paul718e3742002-12-13 20:15:29 +0000300@end deffn
301
Timo Teräs9e7a53c2014-04-24 10:22:37 +0300302@deffn {BGP} {neighbor @var{peer} next-hop-self [all]} {}
303@deffnx {BGP} {no neighbor @var{peer} next-hop-self [all]} {}
paul718e3742002-12-13 20:15:29 +0000304This command specifies an announced route's nexthop as being equivalent
Timo Teräs9e7a53c2014-04-24 10:22:37 +0300305to the address of the bgp router if it is learned via eBGP.
306If the optional keyword @code{all} is specified the modifiation is done
307also for routes learned via iBGP.
paul718e3742002-12-13 20:15:29 +0000308@end deffn
309
Paul Jakma466c9652006-06-26 12:55:58 +0000310@deffn {BGP} {neighbor @var{peer} update-source @var{<ifname|address>}} {}
paul718e3742002-12-13 20:15:29 +0000311@deffnx {BGP} {no neighbor @var{peer} update-source} {}
Paul Jakma825cd492006-05-23 22:20:34 +0000312Specify the IPv4 source address to use for the @acronym{BGP} session to this
313neighbour, may be specified as either an IPv4 address directly or
314as an interface name (in which case the @command{zebra} daemon MUST be running
315in order for @command{bgpd} to be able to retrieve interface state).
316@example
317@group
318router bgp 64555
319 neighbor foo update-source 192.168.0.1
320 neighbor bar update-source lo0
321@end group
322@end example
paul718e3742002-12-13 20:15:29 +0000323@end deffn
324
325@deffn {BGP} {neighbor @var{peer} default-originate} {}
326@deffnx {BGP} {no neighbor @var{peer} default-originate} {}
327@command{bgpd}'s default is to not announce the default route (0.0.0.0/0) even it
328is in routing table. When you want to announce default routes to the
329peer, use this command.
330@end deffn
331
332@deffn {BGP} {neighbor @var{peer} port @var{port}} {}
333@deffnx {BGP} {neighbor @var{peer} port @var{port}} {}
334@end deffn
335
336@deffn {BGP} {neighbor @var{peer} send-community} {}
337@deffnx {BGP} {neighbor @var{peer} send-community} {}
338@end deffn
339
340@deffn {BGP} {neighbor @var{peer} weight @var{weight}} {}
341@deffnx {BGP} {no neighbor @var{peer} weight @var{weight}} {}
342This command specifies a default @var{weight} value for the neighbor's
343routes.
344@end deffn
345
346@deffn {BGP} {neighbor @var{peer} maximum-prefix @var{number}} {}
347@deffnx {BGP} {no neighbor @var{peer} maximum-prefix @var{number}} {}
348@end deffn
349
Andrew Certain5aebb9c2012-11-07 23:50:09 +0000350@deffn {BGP} {neighbor @var{peer} local-as @var{as-number}} {}
351@deffnx {BGP} {neighbor @var{peer} local-as @var{as-number} no-prepend} {}
352@deffnx {BGP} {neighbor @var{peer} local-as @var{as-number} no-prepend replace-as} {}
353@deffnx {BGP} {no neighbor @var{peer} local-as} {}
354Specify an alternate AS for this BGP process when interacting with the
355specified peer. With no modifiers, the specified local-as is prepended to
356the received AS_PATH when receiving routing updates from the peer, and
357prepended to the outgoing AS_PATH (after the process local AS) when
358transmitting local routes to the peer.
359
360If the no-prepend attribute is specified, then the supplied local-as is not
361prepended to the received AS_PATH.
362
363If the replace-as attribute is specified, then only the supplied local-as is
364prepended to the AS_PATH when transmitting local-route updates to this peer.
365
366Note that replace-as can only be specified if no-prepend is.
367
368This command is only allowed for eBGP peers.
369@end deffn
370
Pradosh Mohapatra5d804b42013-09-12 03:37:07 +0000371@deffn {BGP} {neighbor @var{peer} ttl-security hops @var{number}} {}
372@deffnx {BGP} {no neighbor @var{peer} ttl-security hops @var{number}} {}
373This command enforces Generalized TTL Security Mechanism (GTSM), as
374specified in RFC 5082. With this command, only neighbors that are the
375specified number of hops away will be allowed to become neighbors. This
376command is mututally exclusive with @command{ebgp-multihop}.
377@end deffn
378
paul76b89b42004-11-06 17:13:09 +0000379@node Peer filtering
paul718e3742002-12-13 20:15:29 +0000380@subsection Peer filtering
381
382@deffn {BGP} {neighbor @var{peer} distribute-list @var{name} [in|out]} {}
383This command specifies a distribute-list for the peer. @var{direct} is
384@samp{in} or @samp{out}.
385@end deffn
386
387@deffn {BGP command} {neighbor @var{peer} prefix-list @var{name} [in|out]} {}
388@end deffn
389
390@deffn {BGP command} {neighbor @var{peer} filter-list @var{name} [in|out]} {}
391@end deffn
392
393@deffn {BGP} {neighbor @var{peer} route-map @var{name} [in|out]} {}
394Apply a route-map on the neighbor. @var{direct} must be @code{in} or
395@code{out}.
396@end deffn
397
398@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000399@node BGP Peer Group
paul718e3742002-12-13 20:15:29 +0000400@section BGP Peer Group
401
402@deffn {BGP} {neighbor @var{word} peer-group} {}
403This command defines a new peer group.
404@end deffn
405
406@deffn {BGP} {neighbor @var{peer} peer-group @var{word}} {}
407This command bind specific peer to peer group @var{word}.
408@end deffn
409
paul76b89b42004-11-06 17:13:09 +0000410@node BGP Address Family
paul718e3742002-12-13 20:15:29 +0000411@section BGP Address Family
412
paul718e3742002-12-13 20:15:29 +0000413@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000414@node Autonomous System
paul718e3742002-12-13 20:15:29 +0000415@section Autonomous System
416
paulaa5943f2005-11-04 21:53:59 +0000417The @acronym{AS,Autonomous System} number is one of the essential
418element of BGP. BGP is a distance vector routing protocol, and the
419AS-Path framework provides distance vector metric and loop detection to
420BGP. @cite{RFC1930, Guidelines for creation, selection, and
421registration of an Autonomous System (AS)} provides some background on
422the concepts of an AS.
paul718e3742002-12-13 20:15:29 +0000423
paulaa5943f2005-11-04 21:53:59 +0000424The AS number is a two octet value, ranging in value from 1 to 65535.
425The AS numbers 64512 through 65535 are defined as private AS numbers.
426Private AS numbers must not to be advertised in the global Internet.
paul718e3742002-12-13 20:15:29 +0000427
428@menu
429* AS Path Regular Expression::
430* Display BGP Routes by AS Path::
431* AS Path Access List::
432* Using AS Path in Route Map::
433* Private AS Numbers::
434@end menu
435
paul76b89b42004-11-06 17:13:09 +0000436@node AS Path Regular Expression
paul718e3742002-12-13 20:15:29 +0000437@subsection AS Path Regular Expression
438
paulaa5943f2005-11-04 21:53:59 +0000439AS path regular expression can be used for displaying BGP routes and
paul718e3742002-12-13 20:15:29 +0000440AS path access list. AS path regular expression is based on
441@code{POSIX 1003.2} regular expressions. Following description is
442just a subset of @code{POSIX} regular expression. User can use full
443@code{POSIX} regular expression. Adding to that special character '_'
444is added for AS path regular expression.
445
446@table @code
447@item .
448Matches any single character.
449@item *
450Matches 0 or more occurrences of pattern.
451@item +
452Matches 1 or more occurrences of pattern.
453@item ?
454Match 0 or 1 occurrences of pattern.
455@item ^
456Matches the beginning of the line.
457@item $
458Matches the end of the line.
459@item _
460Character @code{_} has special meanings in AS path regular expression.
461It matches to space and comma , and AS set delimiter @{ and @} and AS
462confederation delimiter @code{(} and @code{)}. And it also matches to
463the beginning of the line and the end of the line. So @code{_} can be
464used for AS value boundaries match. @code{show ip bgp regexp _7675_}
465matches to all of BGP routes which as AS number include @var{7675}.
466@end table
467
paul76b89b42004-11-06 17:13:09 +0000468@node Display BGP Routes by AS Path
paul718e3742002-12-13 20:15:29 +0000469@subsection Display BGP Routes by AS Path
470
paulaa5943f2005-11-04 21:53:59 +0000471To show BGP routes which has specific AS path information @code{show
paul718e3742002-12-13 20:15:29 +0000472ip bgp} command can be used.
473
474@deffn Command {show ip bgp regexp @var{line}} {}
475This commands display BGP routes that matches AS path regular
476expression @var{line}.
477@end deffn
478
paul76b89b42004-11-06 17:13:09 +0000479@node AS Path Access List
paul718e3742002-12-13 20:15:29 +0000480@subsection AS Path Access List
481
paulaa5943f2005-11-04 21:53:59 +0000482AS path access list is user defined AS path.
paul718e3742002-12-13 20:15:29 +0000483
484@deffn {Command} {ip as-path access-list @var{word} @{permit|deny@} @var{line}} {}
485This command defines a new AS path access list.
486@end deffn
487
488@deffn {Command} {no ip as-path access-list @var{word}} {}
489@deffnx {Command} {no ip as-path access-list @var{word} @{permit|deny@} @var{line}} {}
490@end deffn
491
paul76b89b42004-11-06 17:13:09 +0000492@node Using AS Path in Route Map
paul718e3742002-12-13 20:15:29 +0000493@subsection Using AS Path in Route Map
494
495@deffn {Route Map} {match as-path @var{word}} {}
496@end deffn
497
498@deffn {Route Map} {set as-path prepend @var{as-path}} {}
499@end deffn
500
paul76b89b42004-11-06 17:13:09 +0000501@node Private AS Numbers
paul718e3742002-12-13 20:15:29 +0000502@subsection Private AS Numbers
503
paul718e3742002-12-13 20:15:29 +0000504@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000505@node BGP Communities Attribute
paul718e3742002-12-13 20:15:29 +0000506@section BGP Communities Attribute
507
paulaa5943f2005-11-04 21:53:59 +0000508BGP communities attribute is widely used for implementing policy
paul718e3742002-12-13 20:15:29 +0000509routing. Network operators can manipulate BGP communities attribute
510based on their network policy. BGP communities attribute is defined
paulaa5943f2005-11-04 21:53:59 +0000511in @cite{RFC1997, BGP Communities Attribute} and
512@cite{RFC1998, An Application of the BGP Community Attribute
paul718e3742002-12-13 20:15:29 +0000513in Multi-home Routing}. It is an optional transitive attribute,
514therefore local policy can travel through different autonomous system.
515
paulaa5943f2005-11-04 21:53:59 +0000516Communities attribute is a set of communities values. Each
paul718e3742002-12-13 20:15:29 +0000517communities value is 4 octet long. The following format is used to
518define communities value.
519
520@table @code
521@item AS:VAL
522This format represents 4 octet communities value. @code{AS} is high
523order 2 octet in digit format. @code{VAL} is low order 2 octet in
524digit format. This format is useful to define AS oriented policy
525value. For example, @code{7675:80} can be used when AS 7675 wants to
526pass local policy value 80 to neighboring peer.
527@item internet
528@code{internet} represents well-known communities value 0.
529@item no-export
530@code{no-export} represents well-known communities value @code{NO_EXPORT}@*
531@r{(0xFFFFFF01)}. All routes carry this value must not be advertised
532to outside a BGP confederation boundary. If neighboring BGP peer is
533part of BGP confederation, the peer is considered as inside a BGP
534confederation boundary, so the route will be announced to the peer.
535@item no-advertise
536@code{no-advertise} represents well-known communities value
537@code{NO_ADVERTISE}@*@r{(0xFFFFFF02)}. All routes carry this value
538must not be advertise to other BGP peers.
539@item local-AS
540@code{local-AS} represents well-known communities value
541@code{NO_EXPORT_SUBCONFED} @r{(0xFFFFFF03)}. All routes carry this
542value must not be advertised to external BGP peers. Even if the
543neighboring router is part of confederation, it is considered as
544external BGP peer, so the route will not be announced to the peer.
545@end table
546
547 When BGP communities attribute is received, duplicated communities
548value in the communities attribute is ignored and each communities
549values are sorted in numerical order.
550
551@menu
552* BGP Community Lists::
553* Numbered BGP Community Lists::
554* BGP Community in Route Map::
555* Display BGP Routes by Community::
556* Using BGP Communities Attribute::
557@end menu
558
paul76b89b42004-11-06 17:13:09 +0000559@node BGP Community Lists
paul718e3742002-12-13 20:15:29 +0000560@subsection BGP Community Lists
561
562 BGP community list is a user defined BGP communites attribute list.
563BGP community list can be used for matching or manipulating BGP
564communities attribute in updates.
565
paulaa5943f2005-11-04 21:53:59 +0000566There are two types of community list. One is standard community
paul718e3742002-12-13 20:15:29 +0000567list and another is expanded community list. Standard community list
568defines communities attribute. Expanded community list defines
569communities attribute string with regular expression. Standard
570community list is compiled into binary format when user define it.
571Standard community list will be directly compared to BGP communities
572attribute in BGP updates. Therefore the comparison is faster than
573expanded community list.
574
575@deffn Command {ip community-list standard @var{name} @{permit|deny@} @var{community}} {}
576This command defines a new standard community list. @var{community}
577is communities value. The @var{community} is compiled into community
578structure. We can define multiple community list under same name. In
579that case match will happen user defined order. Once the
580community list matches to communities attribute in BGP updates it
581return permit or deny by the community list definition. When there is
582no matched entry, deny will be returned. When @var{community} is
583empty it matches to any routes.
584@end deffn
585
586@deffn Command {ip community-list expanded @var{name} @{permit|deny@} @var{line}} {}
587This command defines a new expanded community list. @var{line} is a
588string expression of communities attribute. @var{line} can include
589regular expression to match communities attribute in BGP updates.
590@end deffn
591
592@deffn Command {no ip community-list @var{name}} {}
593@deffnx Command {no ip community-list standard @var{name}} {}
594@deffnx Command {no ip community-list expanded @var{name}} {}
595These commands delete community lists specified by @var{name}. All of
596community lists shares a single name space. So community lists can be
597removed simpley specifying community lists name.
598@end deffn
599
600@deffn {Command} {show ip community-list} {}
601@deffnx {Command} {show ip community-list @var{name}} {}
602This command display current community list information. When
603@var{name} is specified the specified community list's information is
604shown.
605
606@example
607# show ip community-list
608Named Community standard list CLIST
609 permit 7675:80 7675:100 no-export
610 deny internet
611Named Community expanded list EXPAND
612 permit :
613
614# show ip community-list CLIST
615Named Community standard list CLIST
616 permit 7675:80 7675:100 no-export
617 deny internet
618@end example
619@end deffn
620
paul76b89b42004-11-06 17:13:09 +0000621@node Numbered BGP Community Lists
paul718e3742002-12-13 20:15:29 +0000622@subsection Numbered BGP Community Lists
623
paulaa5943f2005-11-04 21:53:59 +0000624When number is used for BGP community list name, the number has
paul718e3742002-12-13 20:15:29 +0000625special meanings. Community list number in the range from 1 and 99 is
626standard community list. Community list number in the range from 100
627to 199 is expanded community list. These community lists are called
628as numbered community lists. On the other hand normal community lists
629is called as named community lists.
630
631@deffn Command {ip community-list <1-99> @{permit|deny@} @var{community}} {}
632This command defines a new community list. <1-99> is standard
633community list number. Community list name within this range defines
634standard community list. When @var{community} is empty it matches to
635any routes.
636@end deffn
637
638@deffn Command {ip community-list <100-199> @{permit|deny@} @var{community}} {}
639This command defines a new community list. <100-199> is expanded
640community list number. Community list name within this range defines
641expanded community list.
642@end deffn
643
644@deffn Command {ip community-list @var{name} @{permit|deny@} @var{community}} {}
645When community list type is not specifed, the community list type is
646automatically detected. If @var{community} can be compiled into
647communities attribute, the community list is defined as a standard
648community list. Otherwise it is defined as an expanded community
649list. This feature is left for backward compability. Use of this
650feature is not recommended.
651@end deffn
652
paul76b89b42004-11-06 17:13:09 +0000653@node BGP Community in Route Map
paul718e3742002-12-13 20:15:29 +0000654@subsection BGP Community in Route Map
655
paulaa5943f2005-11-04 21:53:59 +0000656In Route Map (@pxref{Route Map}), we can match or set BGP
paul718e3742002-12-13 20:15:29 +0000657communities attribute. Using this feature network operator can
658implement their network policy based on BGP communities attribute.
659
paulaa5943f2005-11-04 21:53:59 +0000660Following commands can be used in Route Map.
paul718e3742002-12-13 20:15:29 +0000661
662@deffn {Route Map} {match community @var{word}} {}
663@deffnx {Route Map} {match community @var{word} exact-match} {}
664This command perform match to BGP updates using community list
665@var{word}. When the one of BGP communities value match to the one of
666communities value in community list, it is match. When
667@code{exact-match} keyword is spcified, match happen only when BGP
668updates have completely same communities value specified in the
669community list.
670@end deffn
671
672@deffn {Route Map} {set community none} {}
673@deffnx {Route Map} {set community @var{community}} {}
674@deffnx {Route Map} {set community @var{community} additive} {}
675This command manipulate communities value in BGP updates. When
676@code{none} is specified as communities value, it removes entire
677communities attribute from BGP updates. When @var{community} is not
678@code{none}, specified communities value is set to BGP updates. If
679BGP updates already has BGP communities value, the existing BGP
680communities value is replaced with specified @var{community} value.
681When @code{additive} keyword is specified, @var{community} is appended
682to the existing communities value.
683@end deffn
684
685@deffn {Route Map} {set comm-list @var{word} delete} {}
686This command remove communities value from BGP communities attribute.
687The @var{word} is community list name. When BGP route's communities
688value matches to the community list @var{word}, the communities value
689is removed. When all of communities value is removed eventually, the
690BGP update's communities attribute is completely removed.
691@end deffn
692
paul76b89b42004-11-06 17:13:09 +0000693@node Display BGP Routes by Community
paul718e3742002-12-13 20:15:29 +0000694@subsection Display BGP Routes by Community
695
paulaa5943f2005-11-04 21:53:59 +0000696To show BGP routes which has specific BGP communities attribute,
paul718e3742002-12-13 20:15:29 +0000697@code{show ip bgp} command can be used. The @var{community} value and
698community list can be used for @code{show ip bgp} command.
699
700@deffn Command {show ip bgp community} {}
701@deffnx Command {show ip bgp community @var{community}} {}
702@deffnx Command {show ip bgp community @var{community} exact-match} {}
703@code{show ip bgp community} displays BGP routes which has communities
704attribute. When @var{community} is specified, BGP routes that matches
705@var{community} value is displayed. For this command, @code{internet}
706keyword can't be used for @var{community} value. When
707@code{exact-match} is specified, it display only routes that have an
708exact match.
709@end deffn
710
711@deffn Command {show ip bgp community-list @var{word}} {}
712@deffnx Command {show ip bgp community-list @var{word} exact-match} {}
713This commands display BGP routes that matches community list
714@var{word}. When @code{exact-match} is specified, display only routes
715that have an exact match.
716@end deffn
717
paul76b89b42004-11-06 17:13:09 +0000718@node Using BGP Communities Attribute
paul718e3742002-12-13 20:15:29 +0000719@subsection Using BGP Communities Attribute
720
paulaa5943f2005-11-04 21:53:59 +0000721Following configuration is the most typical usage of BGP communities
paul718e3742002-12-13 20:15:29 +0000722attribute. AS 7675 provides upstream Internet connection to AS 100.
723When following configuration exists in AS 7675, AS 100 networks
724operator can set local preference in AS 7675 network by setting BGP
725communities attribute to the updates.
726
727@example
728router bgp 7675
729 neighbor 192.168.0.1 remote-as 100
730 neighbor 192.168.0.1 route-map RMAP in
731!
732ip community-list 70 permit 7675:70
733ip community-list 70 deny
734ip community-list 80 permit 7675:80
735ip community-list 80 deny
736ip community-list 90 permit 7675:90
737ip community-list 90 deny
738!
739route-map RMAP permit 10
740 match community 70
741 set local-preference 70
742!
743route-map RMAP permit 20
744 match community 80
745 set local-preference 80
746!
747route-map RMAP permit 30
748 match community 90
749 set local-preference 90
750@end example
751
paulaa5943f2005-11-04 21:53:59 +0000752Following configuration announce 10.0.0.0/8 from AS 100 to AS 7675.
paul718e3742002-12-13 20:15:29 +0000753The route has communities value 7675:80 so when above configuration
754exists in AS 7675, announced route's local preference will be set to
755value 80.
756
757@example
758router bgp 100
759 network 10.0.0.0/8
760 neighbor 192.168.0.2 remote-as 7675
761 neighbor 192.168.0.2 route-map RMAP out
762!
763ip prefix-list PLIST permit 10.0.0.0/8
764!
765route-map RMAP permit 10
766 match ip address prefix-list PLIST
767 set community 7675:80
768@end example
769
paulaa5943f2005-11-04 21:53:59 +0000770Following configuration is an example of BGP route filtering using
paul718e3742002-12-13 20:15:29 +0000771communities attribute. This configuration only permit BGP routes
772which has BGP communities value 0:80 or 0:90. Network operator can
773put special internal communities value at BGP border router, then
774limit the BGP routes announcement into the internal network.
775
776@example
777router bgp 7675
778 neighbor 192.168.0.1 remote-as 100
779 neighbor 192.168.0.1 route-map RMAP in
780!
781ip community-list 1 permit 0:80 0:90
782!
783route-map RMAP permit in
784 match community 1
785@end example
786
paulaa5943f2005-11-04 21:53:59 +0000787Following exmaple filter BGP routes which has communities value 1:1.
paul718e3742002-12-13 20:15:29 +0000788When there is no match community-list returns deny. To avoid
789filtering all of routes, we need to define permit any at last.
790
791@example
792router bgp 7675
793 neighbor 192.168.0.1 remote-as 100
794 neighbor 192.168.0.1 route-map RMAP in
795!
796ip community-list standard FILTER deny 1:1
797ip community-list standard FILTER permit
798!
799route-map RMAP permit 10
800 match community FILTER
801@end example
802
paulaa5943f2005-11-04 21:53:59 +0000803Communities value keyword @code{internet} has special meanings in
paul718e3742002-12-13 20:15:29 +0000804standard community lists. In below example @code{internet} act as
805match any. It matches all of BGP routes even if the route does not
806have communities attribute at all. So community list @code{INTERNET}
807is same as above example's @code{FILTER}.
808
809@example
810ip community-list standard INTERNET deny 1:1
811ip community-list standard INTERNET permit internet
812@end example
813
paulaa5943f2005-11-04 21:53:59 +0000814Following configuration is an example of communities value deletion.
paul718e3742002-12-13 20:15:29 +0000815With this configuration communities value 100:1 and 100:2 is removed
816from BGP updates. For communities value deletion, only @code{permit}
817community-list is used. @code{deny} community-list is ignored.
818
819@example
820router bgp 7675
821 neighbor 192.168.0.1 remote-as 100
822 neighbor 192.168.0.1 route-map RMAP in
823!
824ip community-list standard DEL permit 100:1 100:2
825!
826route-map RMAP permit 10
827 set comm-list DEL delete
828@end example
829
830@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000831@node BGP Extended Communities Attribute
paul718e3742002-12-13 20:15:29 +0000832@section BGP Extended Communities Attribute
833
paulaa5943f2005-11-04 21:53:59 +0000834BGP extended communities attribute is introduced with MPLS VPN/BGP
paul718e3742002-12-13 20:15:29 +0000835technology. MPLS VPN/BGP expands capability of network infrastructure
836to provide VPN functionality. At the same time it requires a new
837framework for policy routing. With BGP Extended Communities Attribute
838we can use Route Target or Site of Origin for implementing network
839policy for MPLS VPN/BGP.
840
paulaa5943f2005-11-04 21:53:59 +0000841BGP Extended Communities Attribute is similar to BGP Communities
paul718e3742002-12-13 20:15:29 +0000842Attribute. It is an optional transitive attribute. BGP Extended
843Communities Attribute can carry multiple Extended Community value.
844Each Extended Community value is eight octet length.
845
paulaa5943f2005-11-04 21:53:59 +0000846BGP Extended Communities Attribute provides an extended range
paul718e3742002-12-13 20:15:29 +0000847compared with BGP Communities Attribute. Adding to that there is a
848type field in each value to provides community space structure.
849
paulaa5943f2005-11-04 21:53:59 +0000850There are two format to define Extended Community value. One is AS
paul718e3742002-12-13 20:15:29 +0000851based format the other is IP address based format.
852
853@table @code
854@item AS:VAL
855This is a format to define AS based Extended Community value.
856@code{AS} part is 2 octets Global Administrator subfield in Extended
857Community value. @code{VAL} part is 4 octets Local Administrator
858subfield. @code{7675:100} represents AS 7675 policy value 100.
859@item IP-Address:VAL
860This is a format to define IP address based Extended Community value.
861@code{IP-Address} part is 4 octets Global Administrator subfield.
862@code{VAL} part is 2 octets Local Administrator subfield.
863@code{10.0.0.1:100} represents
864@end table
865
866@menu
867* BGP Extended Community Lists::
868* BGP Extended Communities in Route Map::
869@end menu
870
paul76b89b42004-11-06 17:13:09 +0000871@node BGP Extended Community Lists
paul718e3742002-12-13 20:15:29 +0000872@subsection BGP Extended Community Lists
873
paulaa5943f2005-11-04 21:53:59 +0000874Expanded Community Lists is a user defined BGP Expanded Community
paul718e3742002-12-13 20:15:29 +0000875Lists.
876
877@deffn Command {ip extcommunity-list standard @var{name} @{permit|deny@} @var{extcommunity}} {}
878This command defines a new standard extcommunity-list.
879@var{extcommunity} is extended communities value. The
880@var{extcommunity} is compiled into extended community structure. We
881can define multiple extcommunity-list under same name. In that case
882match will happen user defined order. Once the extcommunity-list
883matches to extended communities attribute in BGP updates it return
884permit or deny based upon the extcommunity-list definition. When
885there is no matched entry, deny will be returned. When
886@var{extcommunity} is empty it matches to any routes.
887@end deffn
888
889@deffn Command {ip extcommunity-list expanded @var{name} @{permit|deny@} @var{line}} {}
890This command defines a new expanded extcommunity-list. @var{line} is
891a string expression of extended communities attribute. @var{line} can
892include regular expression to match extended communities attribute in
893BGP updates.
894@end deffn
895
896@deffn Command {no ip extcommunity-list @var{name}} {}
897@deffnx Command {no ip extcommunity-list standard @var{name}} {}
898@deffnx Command {no ip extcommunity-list expanded @var{name}} {}
899These commands delete extended community lists specified by
900@var{name}. All of extended community lists shares a single name
901space. So extended community lists can be removed simpley specifying
902the name.
903@end deffn
904
905@deffn {Command} {show ip extcommunity-list} {}
906@deffnx {Command} {show ip extcommunity-list @var{name}} {}
907This command display current extcommunity-list information. When
908@var{name} is specified the community list's information is shown.
909
910@example
911# show ip extcommunity-list
912@end example
913@end deffn
914
paul76b89b42004-11-06 17:13:09 +0000915@node BGP Extended Communities in Route Map
paul718e3742002-12-13 20:15:29 +0000916@subsection BGP Extended Communities in Route Map
917
918@deffn {Route Map} {match extcommunity @var{word}} {}
919@end deffn
920
921@deffn {Route Map} {set extcommunity rt @var{extcommunity}} {}
922This command set Route Target value.
923@end deffn
924
925@deffn {Route Map} {set extcommunity soo @var{extcommunity}} {}
926This command set Site of Origin value.
927@end deffn
928
929@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000930@node Displaying BGP routes
paul718e3742002-12-13 20:15:29 +0000931@section Displaying BGP Routes
932
933@menu
934* Show IP BGP::
935* More Show IP BGP::
936@end menu
937
paul76b89b42004-11-06 17:13:09 +0000938@node Show IP BGP
paul718e3742002-12-13 20:15:29 +0000939@subsection Show IP BGP
940
941@deffn {Command} {show ip bgp} {}
942@deffnx {Command} {show ip bgp @var{A.B.C.D}} {}
943@deffnx {Command} {show ip bgp @var{X:X::X:X}} {}
944This command displays BGP routes. When no route is specified it
945display all of IPv4 BGP routes.
946@end deffn
947
948@example
949BGP table version is 0, local router ID is 10.1.1.1
950Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
951Origin codes: i - IGP, e - EGP, ? - incomplete
952
953 Network Next Hop Metric LocPrf Weight Path
954*> 1.1.1.1/32 0.0.0.0 0 32768 i
955
956Total number of prefixes 1
957@end example
958
paul76b89b42004-11-06 17:13:09 +0000959@node More Show IP BGP
paul718e3742002-12-13 20:15:29 +0000960@subsection More Show IP BGP
961
962@deffn {Command} {show ip bgp regexp @var{line}} {}
963This command display BGP routes using AS path regular expression (@pxref{Display BGP Routes by AS Path}).
964@end deffn
965
966@deffn Command {show ip bgp community @var{community}} {}
967@deffnx Command {show ip bgp community @var{community} exact-match} {}
968This command display BGP routes using @var{community} (@pxref{Display
969BGP Routes by Community}).
970@end deffn
971
972@deffn Command {show ip bgp community-list @var{word}} {}
973@deffnx Command {show ip bgp community-list @var{word} exact-match} {}
974This command display BGP routes using community list (@pxref{Display
975BGP Routes by Community}).
976@end deffn
977
978@deffn {Command} {show ip bgp summary} {}
979@end deffn
980
981@deffn {Command} {show ip bgp neighbor [@var{peer}]} {}
982@end deffn
983
984@deffn {Command} {clear ip bgp @var{peer}} {}
985Clear peers which have addresses of X.X.X.X
986@end deffn
987
988@deffn {Command} {clear ip bgp @var{peer} soft in} {}
989Clear peer using soft reconfiguration.
990@end deffn
991
Alexandre Chappuisc31e5722011-09-11 16:54:11 +0400992@deffn {Command} {show ip bgp dampened-paths} {}
993Display paths suppressed due to dampening
994@end deffn
995
996@deffn {Command} {show ip bgp flap-statistics} {}
997Display flap statistics of routes
998@end deffn
999
paul718e3742002-12-13 20:15:29 +00001000@deffn {Command} {show debug} {}
1001@end deffn
1002
1003@deffn {Command} {debug event} {}
1004@end deffn
1005
1006@deffn {Command} {debug update} {}
1007@end deffn
1008
1009@deffn {Command} {debug keepalive} {}
1010@end deffn
1011
1012@deffn {Command} {no debug event} {}
1013@end deffn
1014
1015@deffn {Command} {no debug update} {}
1016@end deffn
1017
1018@deffn {Command} {no debug keepalive} {}
1019@end deffn
1020
paul76b89b42004-11-06 17:13:09 +00001021@node Capability Negotiation
paul718e3742002-12-13 20:15:29 +00001022@section Capability Negotiation
1023
paulaa5943f2005-11-04 21:53:59 +00001024When adding IPv6 routing information exchange feature to BGP. There
1025were some proposals. @acronym{IETF,Internet Engineering Task Force}
1026@acronym{IDR, Inter Domain Routing} @acronym{WG, Working group} adopted
1027a proposal called Multiprotocol Extension for BGP. The specification
1028is described in @cite{RFC2283}. The protocol does not define new protocols.
1029It defines new attributes to existing BGP. When it is used exchanging
1030IPv6 routing information it is called BGP-4+. When it is used for
1031exchanging multicast routing information it is called MBGP.
paul718e3742002-12-13 20:15:29 +00001032
paulaa5943f2005-11-04 21:53:59 +00001033@command{bgpd} supports Multiprotocol Extension for BGP. So if remote
1034peer supports the protocol, @command{bgpd} can exchange IPv6 and/or
1035multicast routing information.
paul718e3742002-12-13 20:15:29 +00001036
paulaa5943f2005-11-04 21:53:59 +00001037Traditional BGP did not have the feature to detect remote peer's
1038capabilities, e.g. whether it can handle prefix types other than IPv4
1039unicast routes. This was a big problem using Multiprotocol Extension
1040for BGP to operational network. @cite{RFC2842, Capabilities
1041Advertisement with BGP-4} adopted a feature called Capability
1042Negotiation. @command{bgpd} use this Capability Negotiation to detect
1043the remote peer's capabilities. If the peer is only configured as IPv4
1044unicast neighbor, @command{bgpd} does not send these Capability
1045Negotiation packets (at least not unless other optional BGP features
1046require capability negotation).
paul718e3742002-12-13 20:15:29 +00001047
paulaa5943f2005-11-04 21:53:59 +00001048By default, Quagga will bring up peering with minimal common capability
1049for the both sides. For example, local router has unicast and
1050multicast capabilitie and remote router has unicast capability. In
1051this case, the local router will establish the connection with unicast
1052only capability. When there are no common capabilities, Quagga sends
1053Unsupported Capability error and then resets the connection.
paul718e3742002-12-13 20:15:29 +00001054
paulaa5943f2005-11-04 21:53:59 +00001055If you want to completely match capabilities with remote peer. Please
paul718e3742002-12-13 20:15:29 +00001056use @command{strict-capability-match} command.
1057
1058@deffn {BGP} {neighbor @var{peer} strict-capability-match} {}
1059@deffnx {BGP} {no neighbor @var{peer} strict-capability-match} {}
1060Strictly compares remote capabilities and local capabilities. If capabilities
1061are different, send Unsupported Capability error then reset connection.
1062@end deffn
1063
paulaa5943f2005-11-04 21:53:59 +00001064You may want to disable sending Capability Negotiation OPEN message
paul718e3742002-12-13 20:15:29 +00001065optional parameter to the peer when remote peer does not implement
1066Capability Negotiation. Please use @command{dont-capability-negotiate}
1067command to disable the feature.
1068
1069@deffn {BGP} {neighbor @var{peer} dont-capability-negotiate} {}
1070@deffnx {BGP} {no neighbor @var{peer} dont-capability-negotiate} {}
1071Suppress sending Capability Negotiation as OPEN message optional
1072parameter to the peer. This command only affects the peer is configured
1073other than IPv4 unicast configuration.
1074@end deffn
1075
paulaa5943f2005-11-04 21:53:59 +00001076When remote peer does not have capability negotiation feature, remote
1077peer will not send any capabilities at all. In that case, bgp
1078configures the peer with configured capabilities.
paul718e3742002-12-13 20:15:29 +00001079
paulaa5943f2005-11-04 21:53:59 +00001080You may prefer locally configured capabilities more than the negotiated
1081capabilities even though remote peer sends capabilities. If the peer
1082is configured by @command{override-capability}, @command{bgpd} ignores
1083received capabilities then override negotiated capabilities with
1084configured values.
paul718e3742002-12-13 20:15:29 +00001085
1086@deffn {BGP} {neighbor @var{peer} override-capability} {}
1087@deffnx {BGP} {no neighbor @var{peer} override-capability} {}
1088Override the result of Capability Negotiation with local configuration.
1089Ignore remote peer's capability value.
1090@end deffn
1091
paul76b89b42004-11-06 17:13:09 +00001092@node Route Reflector
paul718e3742002-12-13 20:15:29 +00001093@section Route Reflector
1094
1095@deffn {BGP} {bgp cluster-id @var{a.b.c.d}} {}
1096@end deffn
1097
1098@deffn {BGP} {neighbor @var{peer} route-reflector-client} {}
1099@deffnx {BGP} {no neighbor @var{peer} route-reflector-client} {}
1100@end deffn
1101
paul76b89b42004-11-06 17:13:09 +00001102@node Route Server
paul718e3742002-12-13 20:15:29 +00001103@section Route Server
1104
1105At an Internet Exchange point, many ISPs are connected to each other by
1106external BGP peering. Normally these external BGP connection are done by
paulaa5943f2005-11-04 21:53:59 +00001107@samp{full mesh} method. As with internal BGP full mesh formation,
paul718e3742002-12-13 20:15:29 +00001108this method has a scaling problem.
1109
1110This scaling problem is well known. Route Server is a method to resolve
1111the problem. Each ISP's BGP router only peers to Route Server. Route
1112Server serves as BGP information exchange to other BGP routers. By
1113applying this method, numbers of BGP connections is reduced from
1114O(n*(n-1)/2) to O(n).
1115
1116Unlike normal BGP router, Route Server must have several routing tables
1117for managing different routing policies for each BGP speaker. We call the
1118routing tables as different @code{view}s. @command{bgpd} can work as
1119normal BGP router or Route Server or both at the same time.
1120
1121@menu
1122* Multiple instance::
1123* BGP instance and view::
1124* Routing policy::
1125* Viewing the view::
1126@end menu
1127
paul76b89b42004-11-06 17:13:09 +00001128@node Multiple instance
paul718e3742002-12-13 20:15:29 +00001129@subsection Multiple instance
1130
1131To enable multiple view function of @code{bgpd}, you must turn on
1132multiple instance feature beforehand.
1133
1134@deffn {Command} {bgp multiple-instance} {}
1135Enable BGP multiple instance feature. After this feature is enabled,
1136you can make multiple BGP instances or multiple BGP views.
1137@end deffn
1138
1139@deffn {Command} {no bgp multiple-instance} {}
1140Disable BGP multiple instance feature. You can not disable this feature
1141when BGP multiple instances or views exist.
1142@end deffn
1143
1144When you want to make configuration more Cisco like one,
1145
1146@deffn {Command} {bgp config-type cisco} {}
1147Cisco compatible BGP configuration output.
1148@end deffn
1149
1150When bgp config-type cisco is specified,
1151
1152``no synchronization'' is displayed.
Ivan Moskalyov2b09e212010-03-11 17:14:35 +03001153``no auto-summary'' is displayed.
paul718e3742002-12-13 20:15:29 +00001154
1155``network'' and ``aggregate-address'' argument is displayed as
1156``A.B.C.D M.M.M.M''
1157
paul7190f4e2003-08-12 12:40:20 +00001158Quagga: network 10.0.0.0/8
paul718e3742002-12-13 20:15:29 +00001159Cisco: network 10.0.0.0
1160
paul7190f4e2003-08-12 12:40:20 +00001161Quagga: aggregate-address 192.168.0.0/24
paul718e3742002-12-13 20:15:29 +00001162Cisco: aggregate-address 192.168.0.0 255.255.255.0
1163
1164Community attribute handling is also different. If there is no
1165configuration is specified community attribute and extended community
1166attribute are sent to neighbor. When user manually disable the
1167feature community attribute is not sent to the neighbor. In case of
paulaa5943f2005-11-04 21:53:59 +00001168@command{bgp config-type cisco} is specified, community attribute is not
paul718e3742002-12-13 20:15:29 +00001169sent to the neighbor by default. To send community attribute user has
paulaa5943f2005-11-04 21:53:59 +00001170to specify @command{neighbor A.B.C.D send-community} command.
paul718e3742002-12-13 20:15:29 +00001171
paulaa5943f2005-11-04 21:53:59 +00001172@example
paul718e3742002-12-13 20:15:29 +00001173!
1174router bgp 1
1175 neighbor 10.0.0.1 remote-as 1
1176 no neighbor 10.0.0.1 send-community
1177!
paul718e3742002-12-13 20:15:29 +00001178router bgp 1
1179 neighbor 10.0.0.1 remote-as 1
1180 neighbor 10.0.0.1 send-community
1181!
paulaa5943f2005-11-04 21:53:59 +00001182@end example
paul718e3742002-12-13 20:15:29 +00001183
1184@deffn {Command} {bgp config-type zebra} {}
paul7190f4e2003-08-12 12:40:20 +00001185Quagga style BGP configuration. This is default.
paul718e3742002-12-13 20:15:29 +00001186@end deffn
1187
paul76b89b42004-11-06 17:13:09 +00001188@node BGP instance and view
paul718e3742002-12-13 20:15:29 +00001189@subsection BGP instance and view
1190
1191BGP instance is a normal BGP process. The result of route selection
1192goes to the kernel routing table. You can setup different AS at the
1193same time when BGP multiple instance feature is enabled.
1194
1195@deffn {Command} {router bgp @var{as-number}} {}
1196Make a new BGP instance. You can use arbitrary word for the @var{name}.
1197@end deffn
1198
1199@example
1200@group
1201bgp multiple-instance
1202!
1203router bgp 1
1204 neighbor 10.0.0.1 remote-as 2
1205 neighbor 10.0.0.2 remote-as 3
1206!
1207router bgp 2
1208 neighbor 10.0.0.3 remote-as 4
1209 neighbor 10.0.0.4 remote-as 5
1210@end group
1211@end example
1212
1213BGP view is almost same as normal BGP process. The result of
1214route selection does not go to the kernel routing table. BGP view is
1215only for exchanging BGP routing information.
1216
1217@deffn {Command} {router bgp @var{as-number} view @var{name}} {}
1218Make a new BGP view. You can use arbitrary word for the @var{name}. This
1219view's route selection result does not go to the kernel routing table.
1220@end deffn
1221
1222With this command, you can setup Route Server like below.
1223
1224@example
1225@group
1226bgp multiple-instance
1227!
1228router bgp 1 view 1
1229 neighbor 10.0.0.1 remote-as 2
1230 neighbor 10.0.0.2 remote-as 3
1231!
1232router bgp 2 view 2
1233 neighbor 10.0.0.3 remote-as 4
1234 neighbor 10.0.0.4 remote-as 5
1235@end group
1236@end example
1237
paul76b89b42004-11-06 17:13:09 +00001238@node Routing policy
paul718e3742002-12-13 20:15:29 +00001239@subsection Routing policy
1240
1241You can set different routing policy for a peer. For example, you can
1242set different filter for a peer.
1243
1244@example
1245@group
1246bgp multiple-instance
1247!
1248router bgp 1 view 1
1249 neighbor 10.0.0.1 remote-as 2
1250 neighbor 10.0.0.1 distribute-list 1 in
1251!
1252router bgp 1 view 2
1253 neighbor 10.0.0.1 remote-as 2
1254 neighbor 10.0.0.1 distribute-list 2 in
1255@end group
1256@end example
1257
1258This means BGP update from a peer 10.0.0.1 goes to both BGP view 1 and view
12592. When the update is inserted into view 1, distribute-list 1 is
1260applied. On the other hand, when the update is inserted into view 2,
1261distribute-list 2 is applied.
1262
paul76b89b42004-11-06 17:13:09 +00001263@node Viewing the view
paul718e3742002-12-13 20:15:29 +00001264@subsection Viewing the view
1265
1266To display routing table of BGP view, you must specify view name.
1267
1268@deffn {Command} {show ip bgp view @var{name}} {}
1269Display routing table of BGP view @var{name}.
1270@end deffn
1271
paul76b89b42004-11-06 17:13:09 +00001272@node How to set up a 6-Bone connection
paul718e3742002-12-13 20:15:29 +00001273@section How to set up a 6-Bone connection
1274
paul6a22b1f2004-11-07 19:39:13 +00001275
paul718e3742002-12-13 20:15:29 +00001276@example
1277@group
1278zebra configuration
1279===================
1280!
1281! Actually there is no need to configure zebra
1282!
1283
1284bgpd configuration
1285==================
1286!
1287! This means that routes go through zebra and into the kernel.
1288!
1289router zebra
1290!
1291! MP-BGP configuration
1292!
1293router bgp 7675
1294 bgp router-id 10.0.0.1
1295 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 remote-as @var{as-number}
1296!
1297 address-family ipv6
1298 network 3ffe:506::/32
1299 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 activate
1300 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 route-map set-nexthop out
1301 neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 remote-as @var{as-number}
1302 neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 route-map set-nexthop out
1303 exit-address-family
1304!
1305ipv6 access-list all permit any
1306!
1307! Set output nexthop address.
1308!
1309route-map set-nexthop permit 10
1310 match ipv6 address all
1311 set ipv6 nexthop global 3ffe:1cfa:0:2:2c0:4fff:fe68:a225
1312 set ipv6 nexthop local fe80::2c0:4fff:fe68:a225
1313!
1314! logfile FILENAME is obsolete. Please use log file FILENAME
paul7190f4e2003-08-12 12:40:20 +00001315
paul718e3742002-12-13 20:15:29 +00001316log file bgpd.log
1317!
1318@end group
1319@end example
1320
paul76b89b42004-11-06 17:13:09 +00001321@node Dump BGP packets and table
paul718e3742002-12-13 20:15:29 +00001322@section Dump BGP packets and table
1323
1324@deffn Command {dump bgp all @var{path}} {}
1325@deffnx Command {dump bgp all @var{path} @var{interval}} {}
1326Dump all BGP packet and events to @var{path} file.
1327@end deffn
1328
1329@deffn Command {dump bgp updates @var{path}} {}
1330@deffnx Command {dump bgp updates @var{path} @var{interval}} {}
1331Dump BGP updates to @var{path} file.
1332@end deffn
1333
1334@deffn Command {dump bgp routes @var{path}} {}
1335@deffnx Command {dump bgp routes @var{path}} {}
1336Dump whole BGP routing table to @var{path}. This is heavy process.
1337@end deffn
paulaa5943f2005-11-04 21:53:59 +00001338
1339@node BGP Configuration Examples
1340@section BGP Configuration Examples
1341
1342Example of a session to an upstream, advertising only one prefix to it.
1343
1344@example
1345router bgp 64512
1346 bgp router-id 10.236.87.1
1347 network 10.236.87.0/24
1348 neighbor upstream peer-group
1349 neighbor upstream remote-as 64515
1350 neighbor upstream capability dynamic
1351 neighbor upstream prefix-list pl-allowed-adv out
1352 neighbor 10.1.1.1 peer-group upstream
1353 neighbor 10.1.1.1 description ACME ISP
1354!
1355ip prefix-list pl-allowed-adv seq 5 permit 82.195.133.0/25
1356ip prefix-list pl-allowed-adv seq 10 deny any
1357
1358@end example
1359
1360A more complex example. With upstream, peer and customer sessions.
1361Advertising global prefixes and NO_EXPORT prefixes and providing
1362actions for customer routes based on community values. Extensive use of
1363route-maps and the 'call' feature to support selective advertising of
1364prefixes. This example is intended as guidance only, it has NOT been
1365tested and almost certainly containts silly mistakes, if not serious
1366flaws.
1367
1368@example
1369router bgp 64512
1370 bgp router-id 10.236.87.1
1371 network 10.123.456.0/24
1372 network 10.123.456.128/25 route-map rm-no-export
1373 neighbor upstream capability dynamic
1374 neighbor upstream route-map rm-upstream-out out
1375 neighbor cust capability dynamic
1376 neighbor cust route-map rm-cust-in in
1377 neighbor cust route-map rm-cust-out out
1378 neighbor cust send-community both
1379 neighbor peer capability dynamic
1380 neighbor peer route-map rm-peer-in in
1381 neighbor peer route-map rm-peer-out out
1382 neighbor peer send-community both
1383 neighbor 10.1.1.1 remote-as 64515
1384 neighbor 10.1.1.1 peer-group upstream
1385 neighbor 10.2.1.1 remote-as 64516
1386 neighbor 10.2.1.1 peer-group upstream
1387 neighbor 10.3.1.1 remote-as 64517
1388 neighbor 10.3.1.1 peer-group cust-default
1389 neighbor 10.3.1.1 description customer1
1390 neighbor 10.3.1.1 prefix-list pl-cust1-network in
1391 neighbor 10.4.1.1 remote-as 64518
1392 neighbor 10.4.1.1 peer-group cust
1393 neighbor 10.4.1.1 prefix-list pl-cust2-network in
1394 neighbor 10.4.1.1 description customer2
1395 neighbor 10.5.1.1 remote-as 64519
1396 neighbor 10.5.1.1 peer-group peer
1397 neighbor 10.5.1.1 prefix-list pl-peer1-network in
1398 neighbor 10.5.1.1 description peer AS 1
1399 neighbor 10.6.1.1 remote-as 64520
1400 neighbor 10.6.1.1 peer-group peer
1401 neighbor 10.6.1.1 prefix-list pl-peer2-network in
1402 neighbor 10.6.1.1 description peer AS 2
1403!
1404ip prefix-list pl-default permit 0.0.0.0/0
1405!
1406ip prefix-list pl-upstream-peers permit 10.1.1.1/32
1407ip prefix-list pl-upstream-peers permit 10.2.1.1/32
1408!
1409ip prefix-list pl-cust1-network permit 10.3.1.0/24
1410ip prefix-list pl-cust1-network permit 10.3.2.0/24
1411!
1412ip prefix-list pl-cust2-network permit 10.4.1.0/24
1413!
1414ip prefix-list pl-peer1-network permit 10.5.1.0/24
1415ip prefix-list pl-peer1-network permit 10.5.2.0/24
1416ip prefix-list pl-peer1-network permit 192.168.0.0/24
1417!
1418ip prefix-list pl-peer2-network permit 10.6.1.0/24
1419ip prefix-list pl-peer2-network permit 10.6.2.0/24
1420ip prefix-list pl-peer2-network permit 192.168.1.0/24
1421ip prefix-list pl-peer2-network permit 192.168.2.0/24
1422ip prefix-list pl-peer2-network permit 172.16.1/24
1423!
1424ip as-path access-list asp-own-as permit ^$
1425ip as-path access-list asp-own-as permit _64512_
1426!
1427! #################################################################
1428! Match communities we provide actions for, on routes receives from
1429! customers. Communities values of <our-ASN>:X, with X, have actions:
1430!
1431! 100 - blackhole the prefix
1432! 200 - set no_export
1433! 300 - advertise only to other customers
1434! 400 - advertise only to upstreams
1435! 500 - set no_export when advertising to upstreams
1436! 2X00 - set local_preference to X00
1437!
1438! blackhole the prefix of the route
1439ip community-list standard cm-blackhole permit 64512:100
1440!
1441! set no-export community before advertising
1442ip community-list standard cm-set-no-export permit 64512:200
1443!
1444! advertise only to other customers
1445ip community-list standard cm-cust-only permit 64512:300
1446!
1447! advertise only to upstreams
1448ip community-list standard cm-upstream-only permit 64512:400
1449!
1450! advertise to upstreams with no-export
1451ip community-list standard cm-upstream-noexport permit 64512:500
1452!
1453! set local-pref to least significant 3 digits of the community
1454ip community-list standard cm-prefmod-100 permit 64512:2100
1455ip community-list standard cm-prefmod-200 permit 64512:2200
1456ip community-list standard cm-prefmod-300 permit 64512:2300
1457ip community-list standard cm-prefmod-400 permit 64512:2400
1458ip community-list expanded cme-prefmod-range permit 64512:2...
1459!
1460! Informational communities
1461!
1462! 3000 - learned from upstream
1463! 3100 - learned from customer
1464! 3200 - learned from peer
1465!
1466ip community-list standard cm-learnt-upstream permit 64512:3000
1467ip community-list standard cm-learnt-cust permit 64512:3100
1468ip community-list standard cm-learnt-peer permit 64512:3200
1469!
1470! ###################################################################
1471! Utility route-maps
1472!
1473! These utility route-maps generally should not used to permit/deny
1474! routes, i.e. they do not have meaning as filters, and hence probably
1475! should be used with 'on-match next'. These all finish with an empty
1476! permit entry so as not interfere with processing in the caller.
1477!
1478route-map rm-no-export permit 10
1479 set community additive no-export
1480route-map rm-no-export permit 20
1481!
1482route-map rm-blackhole permit 10
1483 description blackhole, up-pref and ensure it cant escape this AS
1484 set ip next-hop 127.0.0.1
1485 set local-preference 10
1486 set community additive no-export
1487route-map rm-blackhole permit 20
1488!
1489! Set local-pref as requested
1490route-map rm-prefmod permit 10
1491 match community cm-prefmod-100
1492 set local-preference 100
1493route-map rm-prefmod permit 20
1494 match community cm-prefmod-200
1495 set local-preference 200
1496route-map rm-prefmod permit 30
1497 match community cm-prefmod-300
1498 set local-preference 300
1499route-map rm-prefmod permit 40
1500 match community cm-prefmod-400
1501 set local-preference 400
1502route-map rm-prefmod permit 50
1503!
1504! Community actions to take on receipt of route.
1505route-map rm-community-in permit 10
1506 description check for blackholing, no point continuing if it matches.
1507 match community cm-blackhole
1508 call rm-blackhole
1509route-map rm-community-in permit 20
1510 match community cm-set-no-export
1511 call rm-no-export
1512 on-match next
1513route-map rm-community-in permit 30
1514 match community cme-prefmod-range
1515 call rm-prefmod
1516route-map rm-community-in permit 40
1517!
1518! #####################################################################
1519! Community actions to take when advertising a route.
1520! These are filtering route-maps,
1521!
1522! Deny customer routes to upstream with cust-only set.
1523route-map rm-community-filt-to-upstream deny 10
1524 match community cm-learnt-cust
1525 match community cm-cust-only
1526route-map rm-community-filt-to-upstream permit 20
1527!
1528! Deny customer routes to other customers with upstream-only set.
1529route-map rm-community-filt-to-cust deny 10
1530 match community cm-learnt-cust
1531 match community cm-upstream-only
1532route-map rm-community-filt-to-cust permit 20
1533!
1534! ###################################################################
1535! The top-level route-maps applied to sessions. Further entries could
1536! be added obviously..
1537!
1538! Customers
1539route-map rm-cust-in permit 10
1540 call rm-community-in
1541 on-match next
1542route-map rm-cust-in permit 20
1543 set community additive 64512:3100
1544route-map rm-cust-in permit 30
1545!
1546route-map rm-cust-out permit 10
1547 call rm-community-filt-to-cust
1548 on-match next
1549route-map rm-cust-out permit 20
1550!
1551! Upstream transit ASes
1552route-map rm-upstream-out permit 10
1553 description filter customer prefixes which are marked cust-only
1554 call rm-community-filt-to-upstream
1555 on-match next
1556route-map rm-upstream-out permit 20
1557 description only customer routes are provided to upstreams/peers
1558 match community cm-learnt-cust
1559!
1560! Peer ASes
1561! outbound policy is same as for upstream
1562route-map rm-peer-out permit 10
1563 call rm-upstream-out
1564!
1565route-map rm-peer-in permit 10
1566 set community additive 64512:3200
1567@end example