blob: dd37d3ecd8eb69661312e4152af47939bbf8ca67 [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
Alexandre Chappuisc31e5722011-09-11 16:54:11 +0400127@node BGP route flap dampening
128@subsection BGP route flap dampening
129
130@deffn {BGP} {bgp dampening @var{<1-45>} @var{<1-20000>} @var{<1-20000>} @var{<1-255>}} {}
131This command enables BGP route-flap dampening and specifies dampening parameters.
132
133@table @asis
134@item @asis{half-life}
135Half-life time for the penalty
136@item @asis{reuse-threshold}
137Value to start reusing a route
138@item @asis{suppress-threshold}
139Value to start suppressing a route
140@item @asis{max-suppress}
141Maximum duration to suppress a stable route
142@end table
143
144The route-flap damping algorithm is compatible with @cite{RFC2439}. The use of this command
145is not recommended nowadays, see @uref{http://www.ripe.net/ripe/docs/ripe-378,,RIPE-378}.
146@end deffn
147
paul76b89b42004-11-06 17:13:09 +0000148@node BGP network
paul718e3742002-12-13 20:15:29 +0000149@section BGP network
150
151@menu
152* BGP route::
153* Route Aggregation::
154* Redistribute to BGP::
155@end menu
156
paul76b89b42004-11-06 17:13:09 +0000157@node BGP route
paul718e3742002-12-13 20:15:29 +0000158@subsection BGP route
159
160@deffn {BGP} {network @var{A.B.C.D/M}} {}
161This command adds the announcement network.
162@example
163@group
164router bgp 1
165 network 10.0.0.0/8
166@end group
167@end example
168This configuration example says that network 10.0.0.0/8 will be
169announced to all neighbors. Some vendors' routers don't advertise
Paul Jakma41367172007-08-06 15:24:51 +0000170routes if they aren't present in their IGP routing tables; @code{bgpd}
paul718e3742002-12-13 20:15:29 +0000171doesn't care about IGP routes when announcing its routes.
172@end deffn
173
174@deffn {BGP} {no network @var{A.B.C.D/M}} {}
175@end deffn
176
paul76b89b42004-11-06 17:13:09 +0000177@node Route Aggregation
paul718e3742002-12-13 20:15:29 +0000178@subsection Route Aggregation
179
180@deffn {BGP} {aggregate-address @var{A.B.C.D/M}} {}
181This command specifies an aggregate address.
182@end deffn
183
184@deffn {BGP} {aggregate-address @var{A.B.C.D/M} as-set} {}
185This command specifies an aggregate address. Resulting routes inlucde
186AS set.
187@end deffn
188
189@deffn {BGP} {aggregate-address @var{A.B.C.D/M} summary-only} {}
190This command specifies an aggregate address. Aggreated routes will
191not be announce.
192@end deffn
193
194@deffn {BGP} {no aggregate-address @var{A.B.C.D/M}} {}
195@end deffn
196
paul76b89b42004-11-06 17:13:09 +0000197@node Redistribute to BGP
paul718e3742002-12-13 20:15:29 +0000198@subsection Redistribute to BGP
199
200@deffn {BGP} {redistribute kernel} {}
201Redistribute kernel route to BGP process.
202@end deffn
203
204@deffn {BGP} {redistribute static} {}
205Redistribute static route to BGP process.
206@end deffn
207
208@deffn {BGP} {redistribute connected} {}
209Redistribute connected route to BGP process.
210@end deffn
211
212@deffn {BGP} {redistribute rip} {}
213Redistribute RIP route to BGP process.
214@end deffn
215
216@deffn {BGP} {redistribute ospf} {}
217Redistribute OSPF route to BGP process.
218@end deffn
219
paul76b89b42004-11-06 17:13:09 +0000220@node BGP Peer
paul718e3742002-12-13 20:15:29 +0000221@section BGP Peer
222
223@menu
224* Defining Peer::
225* BGP Peer commands::
226* Peer filtering::
227@end menu
228
paul76b89b42004-11-06 17:13:09 +0000229@node Defining Peer
paul718e3742002-12-13 20:15:29 +0000230@subsection Defining Peer
231
232@deffn {BGP} {neighbor @var{peer} remote-as @var{asn}} {}
233Creates a new neighbor whose remote-as is @var{asn}. @var{peer}
234can be an IPv4 address or an IPv6 address.
235@example
236@group
237router bgp 1
238 neighbor 10.0.0.1 remote-as 2
239@end group
240@end example
241In this case my router, in AS-1, is trying to peer with AS-2 at
24210.0.0.1.
243
244This command must be the first command used when configuring a neighbor.
245If the remote-as is not specified, @command{bgpd} will complain like this:
246@example
247can't find neighbor 10.0.0.1
248@end example
249@end deffn
250
paul76b89b42004-11-06 17:13:09 +0000251@node BGP Peer commands
paul718e3742002-12-13 20:15:29 +0000252@subsection BGP Peer commands
253
254In a @code{router bgp} clause there are neighbor specific configurations
255required.
256
257@deffn {BGP} {neighbor @var{peer} shutdown} {}
258@deffnx {BGP} {no neighbor @var{peer} shutdown} {}
259Shutdown the peer. We can delete the neighbor's configuration by
260@code{no neighbor @var{peer} remote-as @var{as-number}} but all
261configuration of the neighbor will be deleted. When you want to
262preserve the configuration, but want to drop the BGP peer, use this
263syntax.
264@end deffn
265
266@deffn {BGP} {neighbor @var{peer} ebgp-multihop} {}
267@deffnx {BGP} {no neighbor @var{peer} ebgp-multihop} {}
268@end deffn
269
270@deffn {BGP} {neighbor @var{peer} description ...} {}
271@deffnx {BGP} {no neighbor @var{peer} description ...} {}
272Set description of the peer.
273@end deffn
274
275@deffn {BGP} {neighbor @var{peer} version @var{version}} {}
276Set up the neighbor's BGP version. @var{version} can be @var{4},
277@var{4+} or @var{4-}. BGP version @var{4} is the default value used for
278BGP peering. BGP version @var{4+} means that the neighbor supports
279Multiprotocol Extensions for BGP-4. BGP version @var{4-} is similar but
280the neighbor speaks the old Internet-Draft revision 00's Multiprotocol
281Extensions for BGP-4. Some routing software is still using this
282version.
283@end deffn
284
285@deffn {BGP} {neighbor @var{peer} interface @var{ifname}} {}
286@deffnx {BGP} {no neighbor @var{peer} interface @var{ifname}} {}
Paul Jakma825cd492006-05-23 22:20:34 +0000287When you connect to a BGP peer over an IPv6 link-local address, you
288have to specify the @var{ifname} of the interface used for the
289connection. To specify IPv4 session addresses, see the
290@code{neighbor @var{peer} update-source} command below.
291
292This command is deprecated and may be removed in a future release. Its
293use should be avoided.
paul718e3742002-12-13 20:15:29 +0000294@end deffn
295
296@deffn {BGP} {neighbor @var{peer} next-hop-self} {}
297@deffnx {BGP} {no neighbor @var{peer} next-hop-self} {}
298This command specifies an announced route's nexthop as being equivalent
299to the address of the bgp router.
300@end deffn
301
Paul Jakma466c9652006-06-26 12:55:58 +0000302@deffn {BGP} {neighbor @var{peer} update-source @var{<ifname|address>}} {}
paul718e3742002-12-13 20:15:29 +0000303@deffnx {BGP} {no neighbor @var{peer} update-source} {}
Paul Jakma825cd492006-05-23 22:20:34 +0000304Specify the IPv4 source address to use for the @acronym{BGP} session to this
305neighbour, may be specified as either an IPv4 address directly or
306as an interface name (in which case the @command{zebra} daemon MUST be running
307in order for @command{bgpd} to be able to retrieve interface state).
308@example
309@group
310router bgp 64555
311 neighbor foo update-source 192.168.0.1
312 neighbor bar update-source lo0
313@end group
314@end example
paul718e3742002-12-13 20:15:29 +0000315@end deffn
316
317@deffn {BGP} {neighbor @var{peer} default-originate} {}
318@deffnx {BGP} {no neighbor @var{peer} default-originate} {}
319@command{bgpd}'s default is to not announce the default route (0.0.0.0/0) even it
320is in routing table. When you want to announce default routes to the
321peer, use this command.
322@end deffn
323
324@deffn {BGP} {neighbor @var{peer} port @var{port}} {}
325@deffnx {BGP} {neighbor @var{peer} port @var{port}} {}
326@end deffn
327
328@deffn {BGP} {neighbor @var{peer} send-community} {}
329@deffnx {BGP} {neighbor @var{peer} send-community} {}
330@end deffn
331
332@deffn {BGP} {neighbor @var{peer} weight @var{weight}} {}
333@deffnx {BGP} {no neighbor @var{peer} weight @var{weight}} {}
334This command specifies a default @var{weight} value for the neighbor's
335routes.
336@end deffn
337
338@deffn {BGP} {neighbor @var{peer} maximum-prefix @var{number}} {}
339@deffnx {BGP} {no neighbor @var{peer} maximum-prefix @var{number}} {}
340@end deffn
341
Andrew Certain5aebb9c2012-11-07 23:50:09 +0000342@deffn {BGP} {neighbor @var{peer} local-as @var{as-number}} {}
343@deffnx {BGP} {neighbor @var{peer} local-as @var{as-number} no-prepend} {}
344@deffnx {BGP} {neighbor @var{peer} local-as @var{as-number} no-prepend replace-as} {}
345@deffnx {BGP} {no neighbor @var{peer} local-as} {}
346Specify an alternate AS for this BGP process when interacting with the
347specified peer. With no modifiers, the specified local-as is prepended to
348the received AS_PATH when receiving routing updates from the peer, and
349prepended to the outgoing AS_PATH (after the process local AS) when
350transmitting local routes to the peer.
351
352If the no-prepend attribute is specified, then the supplied local-as is not
353prepended to the received AS_PATH.
354
355If the replace-as attribute is specified, then only the supplied local-as is
356prepended to the AS_PATH when transmitting local-route updates to this peer.
357
358Note that replace-as can only be specified if no-prepend is.
359
360This command is only allowed for eBGP peers.
361@end deffn
362
paul76b89b42004-11-06 17:13:09 +0000363@node Peer filtering
paul718e3742002-12-13 20:15:29 +0000364@subsection Peer filtering
365
366@deffn {BGP} {neighbor @var{peer} distribute-list @var{name} [in|out]} {}
367This command specifies a distribute-list for the peer. @var{direct} is
368@samp{in} or @samp{out}.
369@end deffn
370
371@deffn {BGP command} {neighbor @var{peer} prefix-list @var{name} [in|out]} {}
372@end deffn
373
374@deffn {BGP command} {neighbor @var{peer} filter-list @var{name} [in|out]} {}
375@end deffn
376
377@deffn {BGP} {neighbor @var{peer} route-map @var{name} [in|out]} {}
378Apply a route-map on the neighbor. @var{direct} must be @code{in} or
379@code{out}.
380@end deffn
381
382@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000383@node BGP Peer Group
paul718e3742002-12-13 20:15:29 +0000384@section BGP Peer Group
385
386@deffn {BGP} {neighbor @var{word} peer-group} {}
387This command defines a new peer group.
388@end deffn
389
390@deffn {BGP} {neighbor @var{peer} peer-group @var{word}} {}
391This command bind specific peer to peer group @var{word}.
392@end deffn
393
paul76b89b42004-11-06 17:13:09 +0000394@node BGP Address Family
paul718e3742002-12-13 20:15:29 +0000395@section BGP Address Family
396
paul718e3742002-12-13 20:15:29 +0000397@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000398@node Autonomous System
paul718e3742002-12-13 20:15:29 +0000399@section Autonomous System
400
paulaa5943f2005-11-04 21:53:59 +0000401The @acronym{AS,Autonomous System} number is one of the essential
402element of BGP. BGP is a distance vector routing protocol, and the
403AS-Path framework provides distance vector metric and loop detection to
404BGP. @cite{RFC1930, Guidelines for creation, selection, and
405registration of an Autonomous System (AS)} provides some background on
406the concepts of an AS.
paul718e3742002-12-13 20:15:29 +0000407
paulaa5943f2005-11-04 21:53:59 +0000408The AS number is a two octet value, ranging in value from 1 to 65535.
409The AS numbers 64512 through 65535 are defined as private AS numbers.
410Private AS numbers must not to be advertised in the global Internet.
paul718e3742002-12-13 20:15:29 +0000411
412@menu
413* AS Path Regular Expression::
414* Display BGP Routes by AS Path::
415* AS Path Access List::
416* Using AS Path in Route Map::
417* Private AS Numbers::
418@end menu
419
paul76b89b42004-11-06 17:13:09 +0000420@node AS Path Regular Expression
paul718e3742002-12-13 20:15:29 +0000421@subsection AS Path Regular Expression
422
paulaa5943f2005-11-04 21:53:59 +0000423AS path regular expression can be used for displaying BGP routes and
paul718e3742002-12-13 20:15:29 +0000424AS path access list. AS path regular expression is based on
425@code{POSIX 1003.2} regular expressions. Following description is
426just a subset of @code{POSIX} regular expression. User can use full
427@code{POSIX} regular expression. Adding to that special character '_'
428is added for AS path regular expression.
429
430@table @code
431@item .
432Matches any single character.
433@item *
434Matches 0 or more occurrences of pattern.
435@item +
436Matches 1 or more occurrences of pattern.
437@item ?
438Match 0 or 1 occurrences of pattern.
439@item ^
440Matches the beginning of the line.
441@item $
442Matches the end of the line.
443@item _
444Character @code{_} has special meanings in AS path regular expression.
445It matches to space and comma , and AS set delimiter @{ and @} and AS
446confederation delimiter @code{(} and @code{)}. And it also matches to
447the beginning of the line and the end of the line. So @code{_} can be
448used for AS value boundaries match. @code{show ip bgp regexp _7675_}
449matches to all of BGP routes which as AS number include @var{7675}.
450@end table
451
paul76b89b42004-11-06 17:13:09 +0000452@node Display BGP Routes by AS Path
paul718e3742002-12-13 20:15:29 +0000453@subsection Display BGP Routes by AS Path
454
paulaa5943f2005-11-04 21:53:59 +0000455To show BGP routes which has specific AS path information @code{show
paul718e3742002-12-13 20:15:29 +0000456ip bgp} command can be used.
457
458@deffn Command {show ip bgp regexp @var{line}} {}
459This commands display BGP routes that matches AS path regular
460expression @var{line}.
461@end deffn
462
paul76b89b42004-11-06 17:13:09 +0000463@node AS Path Access List
paul718e3742002-12-13 20:15:29 +0000464@subsection AS Path Access List
465
paulaa5943f2005-11-04 21:53:59 +0000466AS path access list is user defined AS path.
paul718e3742002-12-13 20:15:29 +0000467
468@deffn {Command} {ip as-path access-list @var{word} @{permit|deny@} @var{line}} {}
469This command defines a new AS path access list.
470@end deffn
471
472@deffn {Command} {no ip as-path access-list @var{word}} {}
473@deffnx {Command} {no ip as-path access-list @var{word} @{permit|deny@} @var{line}} {}
474@end deffn
475
paul76b89b42004-11-06 17:13:09 +0000476@node Using AS Path in Route Map
paul718e3742002-12-13 20:15:29 +0000477@subsection Using AS Path in Route Map
478
479@deffn {Route Map} {match as-path @var{word}} {}
480@end deffn
481
482@deffn {Route Map} {set as-path prepend @var{as-path}} {}
483@end deffn
484
paul76b89b42004-11-06 17:13:09 +0000485@node Private AS Numbers
paul718e3742002-12-13 20:15:29 +0000486@subsection Private AS Numbers
487
paul718e3742002-12-13 20:15:29 +0000488@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000489@node BGP Communities Attribute
paul718e3742002-12-13 20:15:29 +0000490@section BGP Communities Attribute
491
paulaa5943f2005-11-04 21:53:59 +0000492BGP communities attribute is widely used for implementing policy
paul718e3742002-12-13 20:15:29 +0000493routing. Network operators can manipulate BGP communities attribute
494based on their network policy. BGP communities attribute is defined
paulaa5943f2005-11-04 21:53:59 +0000495in @cite{RFC1997, BGP Communities Attribute} and
496@cite{RFC1998, An Application of the BGP Community Attribute
paul718e3742002-12-13 20:15:29 +0000497in Multi-home Routing}. It is an optional transitive attribute,
498therefore local policy can travel through different autonomous system.
499
paulaa5943f2005-11-04 21:53:59 +0000500Communities attribute is a set of communities values. Each
paul718e3742002-12-13 20:15:29 +0000501communities value is 4 octet long. The following format is used to
502define communities value.
503
504@table @code
505@item AS:VAL
506This format represents 4 octet communities value. @code{AS} is high
507order 2 octet in digit format. @code{VAL} is low order 2 octet in
508digit format. This format is useful to define AS oriented policy
509value. For example, @code{7675:80} can be used when AS 7675 wants to
510pass local policy value 80 to neighboring peer.
511@item internet
512@code{internet} represents well-known communities value 0.
513@item no-export
514@code{no-export} represents well-known communities value @code{NO_EXPORT}@*
515@r{(0xFFFFFF01)}. All routes carry this value must not be advertised
516to outside a BGP confederation boundary. If neighboring BGP peer is
517part of BGP confederation, the peer is considered as inside a BGP
518confederation boundary, so the route will be announced to the peer.
519@item no-advertise
520@code{no-advertise} represents well-known communities value
521@code{NO_ADVERTISE}@*@r{(0xFFFFFF02)}. All routes carry this value
522must not be advertise to other BGP peers.
523@item local-AS
524@code{local-AS} represents well-known communities value
525@code{NO_EXPORT_SUBCONFED} @r{(0xFFFFFF03)}. All routes carry this
526value must not be advertised to external BGP peers. Even if the
527neighboring router is part of confederation, it is considered as
528external BGP peer, so the route will not be announced to the peer.
529@end table
530
531 When BGP communities attribute is received, duplicated communities
532value in the communities attribute is ignored and each communities
533values are sorted in numerical order.
534
535@menu
536* BGP Community Lists::
537* Numbered BGP Community Lists::
538* BGP Community in Route Map::
539* Display BGP Routes by Community::
540* Using BGP Communities Attribute::
541@end menu
542
paul76b89b42004-11-06 17:13:09 +0000543@node BGP Community Lists
paul718e3742002-12-13 20:15:29 +0000544@subsection BGP Community Lists
545
546 BGP community list is a user defined BGP communites attribute list.
547BGP community list can be used for matching or manipulating BGP
548communities attribute in updates.
549
paulaa5943f2005-11-04 21:53:59 +0000550There are two types of community list. One is standard community
paul718e3742002-12-13 20:15:29 +0000551list and another is expanded community list. Standard community list
552defines communities attribute. Expanded community list defines
553communities attribute string with regular expression. Standard
554community list is compiled into binary format when user define it.
555Standard community list will be directly compared to BGP communities
556attribute in BGP updates. Therefore the comparison is faster than
557expanded community list.
558
559@deffn Command {ip community-list standard @var{name} @{permit|deny@} @var{community}} {}
560This command defines a new standard community list. @var{community}
561is communities value. The @var{community} is compiled into community
562structure. We can define multiple community list under same name. In
563that case match will happen user defined order. Once the
564community list matches to communities attribute in BGP updates it
565return permit or deny by the community list definition. When there is
566no matched entry, deny will be returned. When @var{community} is
567empty it matches to any routes.
568@end deffn
569
570@deffn Command {ip community-list expanded @var{name} @{permit|deny@} @var{line}} {}
571This command defines a new expanded community list. @var{line} is a
572string expression of communities attribute. @var{line} can include
573regular expression to match communities attribute in BGP updates.
574@end deffn
575
576@deffn Command {no ip community-list @var{name}} {}
577@deffnx Command {no ip community-list standard @var{name}} {}
578@deffnx Command {no ip community-list expanded @var{name}} {}
579These commands delete community lists specified by @var{name}. All of
580community lists shares a single name space. So community lists can be
581removed simpley specifying community lists name.
582@end deffn
583
584@deffn {Command} {show ip community-list} {}
585@deffnx {Command} {show ip community-list @var{name}} {}
586This command display current community list information. When
587@var{name} is specified the specified community list's information is
588shown.
589
590@example
591# show ip community-list
592Named Community standard list CLIST
593 permit 7675:80 7675:100 no-export
594 deny internet
595Named Community expanded list EXPAND
596 permit :
597
598# show ip community-list CLIST
599Named Community standard list CLIST
600 permit 7675:80 7675:100 no-export
601 deny internet
602@end example
603@end deffn
604
paul76b89b42004-11-06 17:13:09 +0000605@node Numbered BGP Community Lists
paul718e3742002-12-13 20:15:29 +0000606@subsection Numbered BGP Community Lists
607
paulaa5943f2005-11-04 21:53:59 +0000608When number is used for BGP community list name, the number has
paul718e3742002-12-13 20:15:29 +0000609special meanings. Community list number in the range from 1 and 99 is
610standard community list. Community list number in the range from 100
611to 199 is expanded community list. These community lists are called
612as numbered community lists. On the other hand normal community lists
613is called as named community lists.
614
615@deffn Command {ip community-list <1-99> @{permit|deny@} @var{community}} {}
616This command defines a new community list. <1-99> is standard
617community list number. Community list name within this range defines
618standard community list. When @var{community} is empty it matches to
619any routes.
620@end deffn
621
622@deffn Command {ip community-list <100-199> @{permit|deny@} @var{community}} {}
623This command defines a new community list. <100-199> is expanded
624community list number. Community list name within this range defines
625expanded community list.
626@end deffn
627
628@deffn Command {ip community-list @var{name} @{permit|deny@} @var{community}} {}
629When community list type is not specifed, the community list type is
630automatically detected. If @var{community} can be compiled into
631communities attribute, the community list is defined as a standard
632community list. Otherwise it is defined as an expanded community
633list. This feature is left for backward compability. Use of this
634feature is not recommended.
635@end deffn
636
paul76b89b42004-11-06 17:13:09 +0000637@node BGP Community in Route Map
paul718e3742002-12-13 20:15:29 +0000638@subsection BGP Community in Route Map
639
paulaa5943f2005-11-04 21:53:59 +0000640In Route Map (@pxref{Route Map}), we can match or set BGP
paul718e3742002-12-13 20:15:29 +0000641communities attribute. Using this feature network operator can
642implement their network policy based on BGP communities attribute.
643
paulaa5943f2005-11-04 21:53:59 +0000644Following commands can be used in Route Map.
paul718e3742002-12-13 20:15:29 +0000645
646@deffn {Route Map} {match community @var{word}} {}
647@deffnx {Route Map} {match community @var{word} exact-match} {}
648This command perform match to BGP updates using community list
649@var{word}. When the one of BGP communities value match to the one of
650communities value in community list, it is match. When
651@code{exact-match} keyword is spcified, match happen only when BGP
652updates have completely same communities value specified in the
653community list.
654@end deffn
655
656@deffn {Route Map} {set community none} {}
657@deffnx {Route Map} {set community @var{community}} {}
658@deffnx {Route Map} {set community @var{community} additive} {}
659This command manipulate communities value in BGP updates. When
660@code{none} is specified as communities value, it removes entire
661communities attribute from BGP updates. When @var{community} is not
662@code{none}, specified communities value is set to BGP updates. If
663BGP updates already has BGP communities value, the existing BGP
664communities value is replaced with specified @var{community} value.
665When @code{additive} keyword is specified, @var{community} is appended
666to the existing communities value.
667@end deffn
668
669@deffn {Route Map} {set comm-list @var{word} delete} {}
670This command remove communities value from BGP communities attribute.
671The @var{word} is community list name. When BGP route's communities
672value matches to the community list @var{word}, the communities value
673is removed. When all of communities value is removed eventually, the
674BGP update's communities attribute is completely removed.
675@end deffn
676
paul76b89b42004-11-06 17:13:09 +0000677@node Display BGP Routes by Community
paul718e3742002-12-13 20:15:29 +0000678@subsection Display BGP Routes by Community
679
paulaa5943f2005-11-04 21:53:59 +0000680To show BGP routes which has specific BGP communities attribute,
paul718e3742002-12-13 20:15:29 +0000681@code{show ip bgp} command can be used. The @var{community} value and
682community list can be used for @code{show ip bgp} command.
683
684@deffn Command {show ip bgp community} {}
685@deffnx Command {show ip bgp community @var{community}} {}
686@deffnx Command {show ip bgp community @var{community} exact-match} {}
687@code{show ip bgp community} displays BGP routes which has communities
688attribute. When @var{community} is specified, BGP routes that matches
689@var{community} value is displayed. For this command, @code{internet}
690keyword can't be used for @var{community} value. When
691@code{exact-match} is specified, it display only routes that have an
692exact match.
693@end deffn
694
695@deffn Command {show ip bgp community-list @var{word}} {}
696@deffnx Command {show ip bgp community-list @var{word} exact-match} {}
697This commands display BGP routes that matches community list
698@var{word}. When @code{exact-match} is specified, display only routes
699that have an exact match.
700@end deffn
701
paul76b89b42004-11-06 17:13:09 +0000702@node Using BGP Communities Attribute
paul718e3742002-12-13 20:15:29 +0000703@subsection Using BGP Communities Attribute
704
paulaa5943f2005-11-04 21:53:59 +0000705Following configuration is the most typical usage of BGP communities
paul718e3742002-12-13 20:15:29 +0000706attribute. AS 7675 provides upstream Internet connection to AS 100.
707When following configuration exists in AS 7675, AS 100 networks
708operator can set local preference in AS 7675 network by setting BGP
709communities attribute to the updates.
710
711@example
712router bgp 7675
713 neighbor 192.168.0.1 remote-as 100
714 neighbor 192.168.0.1 route-map RMAP in
715!
716ip community-list 70 permit 7675:70
717ip community-list 70 deny
718ip community-list 80 permit 7675:80
719ip community-list 80 deny
720ip community-list 90 permit 7675:90
721ip community-list 90 deny
722!
723route-map RMAP permit 10
724 match community 70
725 set local-preference 70
726!
727route-map RMAP permit 20
728 match community 80
729 set local-preference 80
730!
731route-map RMAP permit 30
732 match community 90
733 set local-preference 90
734@end example
735
paulaa5943f2005-11-04 21:53:59 +0000736Following configuration announce 10.0.0.0/8 from AS 100 to AS 7675.
paul718e3742002-12-13 20:15:29 +0000737The route has communities value 7675:80 so when above configuration
738exists in AS 7675, announced route's local preference will be set to
739value 80.
740
741@example
742router bgp 100
743 network 10.0.0.0/8
744 neighbor 192.168.0.2 remote-as 7675
745 neighbor 192.168.0.2 route-map RMAP out
746!
747ip prefix-list PLIST permit 10.0.0.0/8
748!
749route-map RMAP permit 10
750 match ip address prefix-list PLIST
751 set community 7675:80
752@end example
753
paulaa5943f2005-11-04 21:53:59 +0000754Following configuration is an example of BGP route filtering using
paul718e3742002-12-13 20:15:29 +0000755communities attribute. This configuration only permit BGP routes
756which has BGP communities value 0:80 or 0:90. Network operator can
757put special internal communities value at BGP border router, then
758limit the BGP routes announcement into the internal network.
759
760@example
761router bgp 7675
762 neighbor 192.168.0.1 remote-as 100
763 neighbor 192.168.0.1 route-map RMAP in
764!
765ip community-list 1 permit 0:80 0:90
766!
767route-map RMAP permit in
768 match community 1
769@end example
770
paulaa5943f2005-11-04 21:53:59 +0000771Following exmaple filter BGP routes which has communities value 1:1.
paul718e3742002-12-13 20:15:29 +0000772When there is no match community-list returns deny. To avoid
773filtering all of routes, we need to define permit any at last.
774
775@example
776router bgp 7675
777 neighbor 192.168.0.1 remote-as 100
778 neighbor 192.168.0.1 route-map RMAP in
779!
780ip community-list standard FILTER deny 1:1
781ip community-list standard FILTER permit
782!
783route-map RMAP permit 10
784 match community FILTER
785@end example
786
paulaa5943f2005-11-04 21:53:59 +0000787Communities value keyword @code{internet} has special meanings in
paul718e3742002-12-13 20:15:29 +0000788standard community lists. In below example @code{internet} act as
789match any. It matches all of BGP routes even if the route does not
790have communities attribute at all. So community list @code{INTERNET}
791is same as above example's @code{FILTER}.
792
793@example
794ip community-list standard INTERNET deny 1:1
795ip community-list standard INTERNET permit internet
796@end example
797
paulaa5943f2005-11-04 21:53:59 +0000798Following configuration is an example of communities value deletion.
paul718e3742002-12-13 20:15:29 +0000799With this configuration communities value 100:1 and 100:2 is removed
800from BGP updates. For communities value deletion, only @code{permit}
801community-list is used. @code{deny} community-list is ignored.
802
803@example
804router bgp 7675
805 neighbor 192.168.0.1 remote-as 100
806 neighbor 192.168.0.1 route-map RMAP in
807!
808ip community-list standard DEL permit 100:1 100:2
809!
810route-map RMAP permit 10
811 set comm-list DEL delete
812@end example
813
814@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000815@node BGP Extended Communities Attribute
paul718e3742002-12-13 20:15:29 +0000816@section BGP Extended Communities Attribute
817
paulaa5943f2005-11-04 21:53:59 +0000818BGP extended communities attribute is introduced with MPLS VPN/BGP
paul718e3742002-12-13 20:15:29 +0000819technology. MPLS VPN/BGP expands capability of network infrastructure
820to provide VPN functionality. At the same time it requires a new
821framework for policy routing. With BGP Extended Communities Attribute
822we can use Route Target or Site of Origin for implementing network
823policy for MPLS VPN/BGP.
824
paulaa5943f2005-11-04 21:53:59 +0000825BGP Extended Communities Attribute is similar to BGP Communities
paul718e3742002-12-13 20:15:29 +0000826Attribute. It is an optional transitive attribute. BGP Extended
827Communities Attribute can carry multiple Extended Community value.
828Each Extended Community value is eight octet length.
829
paulaa5943f2005-11-04 21:53:59 +0000830BGP Extended Communities Attribute provides an extended range
paul718e3742002-12-13 20:15:29 +0000831compared with BGP Communities Attribute. Adding to that there is a
832type field in each value to provides community space structure.
833
paulaa5943f2005-11-04 21:53:59 +0000834There are two format to define Extended Community value. One is AS
paul718e3742002-12-13 20:15:29 +0000835based format the other is IP address based format.
836
837@table @code
838@item AS:VAL
839This is a format to define AS based Extended Community value.
840@code{AS} part is 2 octets Global Administrator subfield in Extended
841Community value. @code{VAL} part is 4 octets Local Administrator
842subfield. @code{7675:100} represents AS 7675 policy value 100.
843@item IP-Address:VAL
844This is a format to define IP address based Extended Community value.
845@code{IP-Address} part is 4 octets Global Administrator subfield.
846@code{VAL} part is 2 octets Local Administrator subfield.
847@code{10.0.0.1:100} represents
848@end table
849
850@menu
851* BGP Extended Community Lists::
852* BGP Extended Communities in Route Map::
853@end menu
854
paul76b89b42004-11-06 17:13:09 +0000855@node BGP Extended Community Lists
paul718e3742002-12-13 20:15:29 +0000856@subsection BGP Extended Community Lists
857
paulaa5943f2005-11-04 21:53:59 +0000858Expanded Community Lists is a user defined BGP Expanded Community
paul718e3742002-12-13 20:15:29 +0000859Lists.
860
861@deffn Command {ip extcommunity-list standard @var{name} @{permit|deny@} @var{extcommunity}} {}
862This command defines a new standard extcommunity-list.
863@var{extcommunity} is extended communities value. The
864@var{extcommunity} is compiled into extended community structure. We
865can define multiple extcommunity-list under same name. In that case
866match will happen user defined order. Once the extcommunity-list
867matches to extended communities attribute in BGP updates it return
868permit or deny based upon the extcommunity-list definition. When
869there is no matched entry, deny will be returned. When
870@var{extcommunity} is empty it matches to any routes.
871@end deffn
872
873@deffn Command {ip extcommunity-list expanded @var{name} @{permit|deny@} @var{line}} {}
874This command defines a new expanded extcommunity-list. @var{line} is
875a string expression of extended communities attribute. @var{line} can
876include regular expression to match extended communities attribute in
877BGP updates.
878@end deffn
879
880@deffn Command {no ip extcommunity-list @var{name}} {}
881@deffnx Command {no ip extcommunity-list standard @var{name}} {}
882@deffnx Command {no ip extcommunity-list expanded @var{name}} {}
883These commands delete extended community lists specified by
884@var{name}. All of extended community lists shares a single name
885space. So extended community lists can be removed simpley specifying
886the name.
887@end deffn
888
889@deffn {Command} {show ip extcommunity-list} {}
890@deffnx {Command} {show ip extcommunity-list @var{name}} {}
891This command display current extcommunity-list information. When
892@var{name} is specified the community list's information is shown.
893
894@example
895# show ip extcommunity-list
896@end example
897@end deffn
898
paul76b89b42004-11-06 17:13:09 +0000899@node BGP Extended Communities in Route Map
paul718e3742002-12-13 20:15:29 +0000900@subsection BGP Extended Communities in Route Map
901
902@deffn {Route Map} {match extcommunity @var{word}} {}
903@end deffn
904
905@deffn {Route Map} {set extcommunity rt @var{extcommunity}} {}
906This command set Route Target value.
907@end deffn
908
909@deffn {Route Map} {set extcommunity soo @var{extcommunity}} {}
910This command set Site of Origin value.
911@end deffn
912
913@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000914@node Displaying BGP routes
paul718e3742002-12-13 20:15:29 +0000915@section Displaying BGP Routes
916
917@menu
918* Show IP BGP::
919* More Show IP BGP::
920@end menu
921
paul76b89b42004-11-06 17:13:09 +0000922@node Show IP BGP
paul718e3742002-12-13 20:15:29 +0000923@subsection Show IP BGP
924
925@deffn {Command} {show ip bgp} {}
926@deffnx {Command} {show ip bgp @var{A.B.C.D}} {}
927@deffnx {Command} {show ip bgp @var{X:X::X:X}} {}
928This command displays BGP routes. When no route is specified it
929display all of IPv4 BGP routes.
930@end deffn
931
932@example
933BGP table version is 0, local router ID is 10.1.1.1
934Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
935Origin codes: i - IGP, e - EGP, ? - incomplete
936
937 Network Next Hop Metric LocPrf Weight Path
938*> 1.1.1.1/32 0.0.0.0 0 32768 i
939
940Total number of prefixes 1
941@end example
942
paul76b89b42004-11-06 17:13:09 +0000943@node More Show IP BGP
paul718e3742002-12-13 20:15:29 +0000944@subsection More Show IP BGP
945
946@deffn {Command} {show ip bgp regexp @var{line}} {}
947This command display BGP routes using AS path regular expression (@pxref{Display BGP Routes by AS Path}).
948@end deffn
949
950@deffn Command {show ip bgp community @var{community}} {}
951@deffnx Command {show ip bgp community @var{community} exact-match} {}
952This command display BGP routes using @var{community} (@pxref{Display
953BGP Routes by Community}).
954@end deffn
955
956@deffn Command {show ip bgp community-list @var{word}} {}
957@deffnx Command {show ip bgp community-list @var{word} exact-match} {}
958This command display BGP routes using community list (@pxref{Display
959BGP Routes by Community}).
960@end deffn
961
962@deffn {Command} {show ip bgp summary} {}
963@end deffn
964
965@deffn {Command} {show ip bgp neighbor [@var{peer}]} {}
966@end deffn
967
968@deffn {Command} {clear ip bgp @var{peer}} {}
969Clear peers which have addresses of X.X.X.X
970@end deffn
971
972@deffn {Command} {clear ip bgp @var{peer} soft in} {}
973Clear peer using soft reconfiguration.
974@end deffn
975
Alexandre Chappuisc31e5722011-09-11 16:54:11 +0400976@deffn {Command} {show ip bgp dampened-paths} {}
977Display paths suppressed due to dampening
978@end deffn
979
980@deffn {Command} {show ip bgp flap-statistics} {}
981Display flap statistics of routes
982@end deffn
983
paul718e3742002-12-13 20:15:29 +0000984@deffn {Command} {show debug} {}
985@end deffn
986
987@deffn {Command} {debug event} {}
988@end deffn
989
990@deffn {Command} {debug update} {}
991@end deffn
992
993@deffn {Command} {debug keepalive} {}
994@end deffn
995
996@deffn {Command} {no debug event} {}
997@end deffn
998
999@deffn {Command} {no debug update} {}
1000@end deffn
1001
1002@deffn {Command} {no debug keepalive} {}
1003@end deffn
1004
paul76b89b42004-11-06 17:13:09 +00001005@node Capability Negotiation
paul718e3742002-12-13 20:15:29 +00001006@section Capability Negotiation
1007
paulaa5943f2005-11-04 21:53:59 +00001008When adding IPv6 routing information exchange feature to BGP. There
1009were some proposals. @acronym{IETF,Internet Engineering Task Force}
1010@acronym{IDR, Inter Domain Routing} @acronym{WG, Working group} adopted
1011a proposal called Multiprotocol Extension for BGP. The specification
1012is described in @cite{RFC2283}. The protocol does not define new protocols.
1013It defines new attributes to existing BGP. When it is used exchanging
1014IPv6 routing information it is called BGP-4+. When it is used for
1015exchanging multicast routing information it is called MBGP.
paul718e3742002-12-13 20:15:29 +00001016
paulaa5943f2005-11-04 21:53:59 +00001017@command{bgpd} supports Multiprotocol Extension for BGP. So if remote
1018peer supports the protocol, @command{bgpd} can exchange IPv6 and/or
1019multicast routing information.
paul718e3742002-12-13 20:15:29 +00001020
paulaa5943f2005-11-04 21:53:59 +00001021Traditional BGP did not have the feature to detect remote peer's
1022capabilities, e.g. whether it can handle prefix types other than IPv4
1023unicast routes. This was a big problem using Multiprotocol Extension
1024for BGP to operational network. @cite{RFC2842, Capabilities
1025Advertisement with BGP-4} adopted a feature called Capability
1026Negotiation. @command{bgpd} use this Capability Negotiation to detect
1027the remote peer's capabilities. If the peer is only configured as IPv4
1028unicast neighbor, @command{bgpd} does not send these Capability
1029Negotiation packets (at least not unless other optional BGP features
1030require capability negotation).
paul718e3742002-12-13 20:15:29 +00001031
paulaa5943f2005-11-04 21:53:59 +00001032By default, Quagga will bring up peering with minimal common capability
1033for the both sides. For example, local router has unicast and
1034multicast capabilitie and remote router has unicast capability. In
1035this case, the local router will establish the connection with unicast
1036only capability. When there are no common capabilities, Quagga sends
1037Unsupported Capability error and then resets the connection.
paul718e3742002-12-13 20:15:29 +00001038
paulaa5943f2005-11-04 21:53:59 +00001039If you want to completely match capabilities with remote peer. Please
paul718e3742002-12-13 20:15:29 +00001040use @command{strict-capability-match} command.
1041
1042@deffn {BGP} {neighbor @var{peer} strict-capability-match} {}
1043@deffnx {BGP} {no neighbor @var{peer} strict-capability-match} {}
1044Strictly compares remote capabilities and local capabilities. If capabilities
1045are different, send Unsupported Capability error then reset connection.
1046@end deffn
1047
paulaa5943f2005-11-04 21:53:59 +00001048You may want to disable sending Capability Negotiation OPEN message
paul718e3742002-12-13 20:15:29 +00001049optional parameter to the peer when remote peer does not implement
1050Capability Negotiation. Please use @command{dont-capability-negotiate}
1051command to disable the feature.
1052
1053@deffn {BGP} {neighbor @var{peer} dont-capability-negotiate} {}
1054@deffnx {BGP} {no neighbor @var{peer} dont-capability-negotiate} {}
1055Suppress sending Capability Negotiation as OPEN message optional
1056parameter to the peer. This command only affects the peer is configured
1057other than IPv4 unicast configuration.
1058@end deffn
1059
paulaa5943f2005-11-04 21:53:59 +00001060When remote peer does not have capability negotiation feature, remote
1061peer will not send any capabilities at all. In that case, bgp
1062configures the peer with configured capabilities.
paul718e3742002-12-13 20:15:29 +00001063
paulaa5943f2005-11-04 21:53:59 +00001064You may prefer locally configured capabilities more than the negotiated
1065capabilities even though remote peer sends capabilities. If the peer
1066is configured by @command{override-capability}, @command{bgpd} ignores
1067received capabilities then override negotiated capabilities with
1068configured values.
paul718e3742002-12-13 20:15:29 +00001069
1070@deffn {BGP} {neighbor @var{peer} override-capability} {}
1071@deffnx {BGP} {no neighbor @var{peer} override-capability} {}
1072Override the result of Capability Negotiation with local configuration.
1073Ignore remote peer's capability value.
1074@end deffn
1075
paul76b89b42004-11-06 17:13:09 +00001076@node Route Reflector
paul718e3742002-12-13 20:15:29 +00001077@section Route Reflector
1078
1079@deffn {BGP} {bgp cluster-id @var{a.b.c.d}} {}
1080@end deffn
1081
1082@deffn {BGP} {neighbor @var{peer} route-reflector-client} {}
1083@deffnx {BGP} {no neighbor @var{peer} route-reflector-client} {}
1084@end deffn
1085
paul76b89b42004-11-06 17:13:09 +00001086@node Route Server
paul718e3742002-12-13 20:15:29 +00001087@section Route Server
1088
1089At an Internet Exchange point, many ISPs are connected to each other by
1090external BGP peering. Normally these external BGP connection are done by
paulaa5943f2005-11-04 21:53:59 +00001091@samp{full mesh} method. As with internal BGP full mesh formation,
paul718e3742002-12-13 20:15:29 +00001092this method has a scaling problem.
1093
1094This scaling problem is well known. Route Server is a method to resolve
1095the problem. Each ISP's BGP router only peers to Route Server. Route
1096Server serves as BGP information exchange to other BGP routers. By
1097applying this method, numbers of BGP connections is reduced from
1098O(n*(n-1)/2) to O(n).
1099
1100Unlike normal BGP router, Route Server must have several routing tables
1101for managing different routing policies for each BGP speaker. We call the
1102routing tables as different @code{view}s. @command{bgpd} can work as
1103normal BGP router or Route Server or both at the same time.
1104
1105@menu
1106* Multiple instance::
1107* BGP instance and view::
1108* Routing policy::
1109* Viewing the view::
1110@end menu
1111
paul76b89b42004-11-06 17:13:09 +00001112@node Multiple instance
paul718e3742002-12-13 20:15:29 +00001113@subsection Multiple instance
1114
1115To enable multiple view function of @code{bgpd}, you must turn on
1116multiple instance feature beforehand.
1117
1118@deffn {Command} {bgp multiple-instance} {}
1119Enable BGP multiple instance feature. After this feature is enabled,
1120you can make multiple BGP instances or multiple BGP views.
1121@end deffn
1122
1123@deffn {Command} {no bgp multiple-instance} {}
1124Disable BGP multiple instance feature. You can not disable this feature
1125when BGP multiple instances or views exist.
1126@end deffn
1127
1128When you want to make configuration more Cisco like one,
1129
1130@deffn {Command} {bgp config-type cisco} {}
1131Cisco compatible BGP configuration output.
1132@end deffn
1133
1134When bgp config-type cisco is specified,
1135
1136``no synchronization'' is displayed.
Ivan Moskalyov2b09e212010-03-11 17:14:35 +03001137``no auto-summary'' is displayed.
paul718e3742002-12-13 20:15:29 +00001138
1139``network'' and ``aggregate-address'' argument is displayed as
1140``A.B.C.D M.M.M.M''
1141
paul7190f4e2003-08-12 12:40:20 +00001142Quagga: network 10.0.0.0/8
paul718e3742002-12-13 20:15:29 +00001143Cisco: network 10.0.0.0
1144
paul7190f4e2003-08-12 12:40:20 +00001145Quagga: aggregate-address 192.168.0.0/24
paul718e3742002-12-13 20:15:29 +00001146Cisco: aggregate-address 192.168.0.0 255.255.255.0
1147
1148Community attribute handling is also different. If there is no
1149configuration is specified community attribute and extended community
1150attribute are sent to neighbor. When user manually disable the
1151feature community attribute is not sent to the neighbor. In case of
paulaa5943f2005-11-04 21:53:59 +00001152@command{bgp config-type cisco} is specified, community attribute is not
paul718e3742002-12-13 20:15:29 +00001153sent to the neighbor by default. To send community attribute user has
paulaa5943f2005-11-04 21:53:59 +00001154to specify @command{neighbor A.B.C.D send-community} command.
paul718e3742002-12-13 20:15:29 +00001155
paulaa5943f2005-11-04 21:53:59 +00001156@example
paul718e3742002-12-13 20:15:29 +00001157!
1158router bgp 1
1159 neighbor 10.0.0.1 remote-as 1
1160 no neighbor 10.0.0.1 send-community
1161!
paul718e3742002-12-13 20:15:29 +00001162router bgp 1
1163 neighbor 10.0.0.1 remote-as 1
1164 neighbor 10.0.0.1 send-community
1165!
paulaa5943f2005-11-04 21:53:59 +00001166@end example
paul718e3742002-12-13 20:15:29 +00001167
1168@deffn {Command} {bgp config-type zebra} {}
paul7190f4e2003-08-12 12:40:20 +00001169Quagga style BGP configuration. This is default.
paul718e3742002-12-13 20:15:29 +00001170@end deffn
1171
paul76b89b42004-11-06 17:13:09 +00001172@node BGP instance and view
paul718e3742002-12-13 20:15:29 +00001173@subsection BGP instance and view
1174
1175BGP instance is a normal BGP process. The result of route selection
1176goes to the kernel routing table. You can setup different AS at the
1177same time when BGP multiple instance feature is enabled.
1178
1179@deffn {Command} {router bgp @var{as-number}} {}
1180Make a new BGP instance. You can use arbitrary word for the @var{name}.
1181@end deffn
1182
1183@example
1184@group
1185bgp multiple-instance
1186!
1187router bgp 1
1188 neighbor 10.0.0.1 remote-as 2
1189 neighbor 10.0.0.2 remote-as 3
1190!
1191router bgp 2
1192 neighbor 10.0.0.3 remote-as 4
1193 neighbor 10.0.0.4 remote-as 5
1194@end group
1195@end example
1196
1197BGP view is almost same as normal BGP process. The result of
1198route selection does not go to the kernel routing table. BGP view is
1199only for exchanging BGP routing information.
1200
1201@deffn {Command} {router bgp @var{as-number} view @var{name}} {}
1202Make a new BGP view. You can use arbitrary word for the @var{name}. This
1203view's route selection result does not go to the kernel routing table.
1204@end deffn
1205
1206With this command, you can setup Route Server like below.
1207
1208@example
1209@group
1210bgp multiple-instance
1211!
1212router bgp 1 view 1
1213 neighbor 10.0.0.1 remote-as 2
1214 neighbor 10.0.0.2 remote-as 3
1215!
1216router bgp 2 view 2
1217 neighbor 10.0.0.3 remote-as 4
1218 neighbor 10.0.0.4 remote-as 5
1219@end group
1220@end example
1221
paul76b89b42004-11-06 17:13:09 +00001222@node Routing policy
paul718e3742002-12-13 20:15:29 +00001223@subsection Routing policy
1224
1225You can set different routing policy for a peer. For example, you can
1226set different filter for a peer.
1227
1228@example
1229@group
1230bgp multiple-instance
1231!
1232router bgp 1 view 1
1233 neighbor 10.0.0.1 remote-as 2
1234 neighbor 10.0.0.1 distribute-list 1 in
1235!
1236router bgp 1 view 2
1237 neighbor 10.0.0.1 remote-as 2
1238 neighbor 10.0.0.1 distribute-list 2 in
1239@end group
1240@end example
1241
1242This means BGP update from a peer 10.0.0.1 goes to both BGP view 1 and view
12432. When the update is inserted into view 1, distribute-list 1 is
1244applied. On the other hand, when the update is inserted into view 2,
1245distribute-list 2 is applied.
1246
paul76b89b42004-11-06 17:13:09 +00001247@node Viewing the view
paul718e3742002-12-13 20:15:29 +00001248@subsection Viewing the view
1249
1250To display routing table of BGP view, you must specify view name.
1251
1252@deffn {Command} {show ip bgp view @var{name}} {}
1253Display routing table of BGP view @var{name}.
1254@end deffn
1255
paul76b89b42004-11-06 17:13:09 +00001256@node How to set up a 6-Bone connection
paul718e3742002-12-13 20:15:29 +00001257@section How to set up a 6-Bone connection
1258
paul6a22b1f2004-11-07 19:39:13 +00001259
paul718e3742002-12-13 20:15:29 +00001260@example
1261@group
1262zebra configuration
1263===================
1264!
1265! Actually there is no need to configure zebra
1266!
1267
1268bgpd configuration
1269==================
1270!
1271! This means that routes go through zebra and into the kernel.
1272!
1273router zebra
1274!
1275! MP-BGP configuration
1276!
1277router bgp 7675
1278 bgp router-id 10.0.0.1
1279 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 remote-as @var{as-number}
1280!
1281 address-family ipv6
1282 network 3ffe:506::/32
1283 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 activate
1284 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 route-map set-nexthop out
1285 neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 remote-as @var{as-number}
1286 neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 route-map set-nexthop out
1287 exit-address-family
1288!
1289ipv6 access-list all permit any
1290!
1291! Set output nexthop address.
1292!
1293route-map set-nexthop permit 10
1294 match ipv6 address all
1295 set ipv6 nexthop global 3ffe:1cfa:0:2:2c0:4fff:fe68:a225
1296 set ipv6 nexthop local fe80::2c0:4fff:fe68:a225
1297!
1298! logfile FILENAME is obsolete. Please use log file FILENAME
paul7190f4e2003-08-12 12:40:20 +00001299
paul718e3742002-12-13 20:15:29 +00001300log file bgpd.log
1301!
1302@end group
1303@end example
1304
paul76b89b42004-11-06 17:13:09 +00001305@node Dump BGP packets and table
paul718e3742002-12-13 20:15:29 +00001306@section Dump BGP packets and table
1307
1308@deffn Command {dump bgp all @var{path}} {}
1309@deffnx Command {dump bgp all @var{path} @var{interval}} {}
1310Dump all BGP packet and events to @var{path} file.
1311@end deffn
1312
1313@deffn Command {dump bgp updates @var{path}} {}
1314@deffnx Command {dump bgp updates @var{path} @var{interval}} {}
1315Dump BGP updates to @var{path} file.
1316@end deffn
1317
1318@deffn Command {dump bgp routes @var{path}} {}
1319@deffnx Command {dump bgp routes @var{path}} {}
1320Dump whole BGP routing table to @var{path}. This is heavy process.
1321@end deffn
paulaa5943f2005-11-04 21:53:59 +00001322
1323@node BGP Configuration Examples
1324@section BGP Configuration Examples
1325
1326Example of a session to an upstream, advertising only one prefix to it.
1327
1328@example
1329router bgp 64512
1330 bgp router-id 10.236.87.1
1331 network 10.236.87.0/24
1332 neighbor upstream peer-group
1333 neighbor upstream remote-as 64515
1334 neighbor upstream capability dynamic
1335 neighbor upstream prefix-list pl-allowed-adv out
1336 neighbor 10.1.1.1 peer-group upstream
1337 neighbor 10.1.1.1 description ACME ISP
1338!
1339ip prefix-list pl-allowed-adv seq 5 permit 82.195.133.0/25
1340ip prefix-list pl-allowed-adv seq 10 deny any
1341
1342@end example
1343
1344A more complex example. With upstream, peer and customer sessions.
1345Advertising global prefixes and NO_EXPORT prefixes and providing
1346actions for customer routes based on community values. Extensive use of
1347route-maps and the 'call' feature to support selective advertising of
1348prefixes. This example is intended as guidance only, it has NOT been
1349tested and almost certainly containts silly mistakes, if not serious
1350flaws.
1351
1352@example
1353router bgp 64512
1354 bgp router-id 10.236.87.1
1355 network 10.123.456.0/24
1356 network 10.123.456.128/25 route-map rm-no-export
1357 neighbor upstream capability dynamic
1358 neighbor upstream route-map rm-upstream-out out
1359 neighbor cust capability dynamic
1360 neighbor cust route-map rm-cust-in in
1361 neighbor cust route-map rm-cust-out out
1362 neighbor cust send-community both
1363 neighbor peer capability dynamic
1364 neighbor peer route-map rm-peer-in in
1365 neighbor peer route-map rm-peer-out out
1366 neighbor peer send-community both
1367 neighbor 10.1.1.1 remote-as 64515
1368 neighbor 10.1.1.1 peer-group upstream
1369 neighbor 10.2.1.1 remote-as 64516
1370 neighbor 10.2.1.1 peer-group upstream
1371 neighbor 10.3.1.1 remote-as 64517
1372 neighbor 10.3.1.1 peer-group cust-default
1373 neighbor 10.3.1.1 description customer1
1374 neighbor 10.3.1.1 prefix-list pl-cust1-network in
1375 neighbor 10.4.1.1 remote-as 64518
1376 neighbor 10.4.1.1 peer-group cust
1377 neighbor 10.4.1.1 prefix-list pl-cust2-network in
1378 neighbor 10.4.1.1 description customer2
1379 neighbor 10.5.1.1 remote-as 64519
1380 neighbor 10.5.1.1 peer-group peer
1381 neighbor 10.5.1.1 prefix-list pl-peer1-network in
1382 neighbor 10.5.1.1 description peer AS 1
1383 neighbor 10.6.1.1 remote-as 64520
1384 neighbor 10.6.1.1 peer-group peer
1385 neighbor 10.6.1.1 prefix-list pl-peer2-network in
1386 neighbor 10.6.1.1 description peer AS 2
1387!
1388ip prefix-list pl-default permit 0.0.0.0/0
1389!
1390ip prefix-list pl-upstream-peers permit 10.1.1.1/32
1391ip prefix-list pl-upstream-peers permit 10.2.1.1/32
1392!
1393ip prefix-list pl-cust1-network permit 10.3.1.0/24
1394ip prefix-list pl-cust1-network permit 10.3.2.0/24
1395!
1396ip prefix-list pl-cust2-network permit 10.4.1.0/24
1397!
1398ip prefix-list pl-peer1-network permit 10.5.1.0/24
1399ip prefix-list pl-peer1-network permit 10.5.2.0/24
1400ip prefix-list pl-peer1-network permit 192.168.0.0/24
1401!
1402ip prefix-list pl-peer2-network permit 10.6.1.0/24
1403ip prefix-list pl-peer2-network permit 10.6.2.0/24
1404ip prefix-list pl-peer2-network permit 192.168.1.0/24
1405ip prefix-list pl-peer2-network permit 192.168.2.0/24
1406ip prefix-list pl-peer2-network permit 172.16.1/24
1407!
1408ip as-path access-list asp-own-as permit ^$
1409ip as-path access-list asp-own-as permit _64512_
1410!
1411! #################################################################
1412! Match communities we provide actions for, on routes receives from
1413! customers. Communities values of <our-ASN>:X, with X, have actions:
1414!
1415! 100 - blackhole the prefix
1416! 200 - set no_export
1417! 300 - advertise only to other customers
1418! 400 - advertise only to upstreams
1419! 500 - set no_export when advertising to upstreams
1420! 2X00 - set local_preference to X00
1421!
1422! blackhole the prefix of the route
1423ip community-list standard cm-blackhole permit 64512:100
1424!
1425! set no-export community before advertising
1426ip community-list standard cm-set-no-export permit 64512:200
1427!
1428! advertise only to other customers
1429ip community-list standard cm-cust-only permit 64512:300
1430!
1431! advertise only to upstreams
1432ip community-list standard cm-upstream-only permit 64512:400
1433!
1434! advertise to upstreams with no-export
1435ip community-list standard cm-upstream-noexport permit 64512:500
1436!
1437! set local-pref to least significant 3 digits of the community
1438ip community-list standard cm-prefmod-100 permit 64512:2100
1439ip community-list standard cm-prefmod-200 permit 64512:2200
1440ip community-list standard cm-prefmod-300 permit 64512:2300
1441ip community-list standard cm-prefmod-400 permit 64512:2400
1442ip community-list expanded cme-prefmod-range permit 64512:2...
1443!
1444! Informational communities
1445!
1446! 3000 - learned from upstream
1447! 3100 - learned from customer
1448! 3200 - learned from peer
1449!
1450ip community-list standard cm-learnt-upstream permit 64512:3000
1451ip community-list standard cm-learnt-cust permit 64512:3100
1452ip community-list standard cm-learnt-peer permit 64512:3200
1453!
1454! ###################################################################
1455! Utility route-maps
1456!
1457! These utility route-maps generally should not used to permit/deny
1458! routes, i.e. they do not have meaning as filters, and hence probably
1459! should be used with 'on-match next'. These all finish with an empty
1460! permit entry so as not interfere with processing in the caller.
1461!
1462route-map rm-no-export permit 10
1463 set community additive no-export
1464route-map rm-no-export permit 20
1465!
1466route-map rm-blackhole permit 10
1467 description blackhole, up-pref and ensure it cant escape this AS
1468 set ip next-hop 127.0.0.1
1469 set local-preference 10
1470 set community additive no-export
1471route-map rm-blackhole permit 20
1472!
1473! Set local-pref as requested
1474route-map rm-prefmod permit 10
1475 match community cm-prefmod-100
1476 set local-preference 100
1477route-map rm-prefmod permit 20
1478 match community cm-prefmod-200
1479 set local-preference 200
1480route-map rm-prefmod permit 30
1481 match community cm-prefmod-300
1482 set local-preference 300
1483route-map rm-prefmod permit 40
1484 match community cm-prefmod-400
1485 set local-preference 400
1486route-map rm-prefmod permit 50
1487!
1488! Community actions to take on receipt of route.
1489route-map rm-community-in permit 10
1490 description check for blackholing, no point continuing if it matches.
1491 match community cm-blackhole
1492 call rm-blackhole
1493route-map rm-community-in permit 20
1494 match community cm-set-no-export
1495 call rm-no-export
1496 on-match next
1497route-map rm-community-in permit 30
1498 match community cme-prefmod-range
1499 call rm-prefmod
1500route-map rm-community-in permit 40
1501!
1502! #####################################################################
1503! Community actions to take when advertising a route.
1504! These are filtering route-maps,
1505!
1506! Deny customer routes to upstream with cust-only set.
1507route-map rm-community-filt-to-upstream deny 10
1508 match community cm-learnt-cust
1509 match community cm-cust-only
1510route-map rm-community-filt-to-upstream permit 20
1511!
1512! Deny customer routes to other customers with upstream-only set.
1513route-map rm-community-filt-to-cust deny 10
1514 match community cm-learnt-cust
1515 match community cm-upstream-only
1516route-map rm-community-filt-to-cust permit 20
1517!
1518! ###################################################################
1519! The top-level route-maps applied to sessions. Further entries could
1520! be added obviously..
1521!
1522! Customers
1523route-map rm-cust-in permit 10
1524 call rm-community-in
1525 on-match next
1526route-map rm-cust-in permit 20
1527 set community additive 64512:3100
1528route-map rm-cust-in permit 30
1529!
1530route-map rm-cust-out permit 10
1531 call rm-community-filt-to-cust
1532 on-match next
1533route-map rm-cust-out permit 20
1534!
1535! Upstream transit ASes
1536route-map rm-upstream-out permit 10
1537 description filter customer prefixes which are marked cust-only
1538 call rm-community-filt-to-upstream
1539 on-match next
1540route-map rm-upstream-out permit 20
1541 description only customer routes are provided to upstreams/peers
1542 match community cm-learnt-cust
1543!
1544! Peer ASes
1545! outbound policy is same as for upstream
1546route-map rm-peer-out permit 10
1547 call rm-upstream-out
1548!
1549route-map rm-peer-in permit 10
1550 set community additive 64512:3200
1551@end example