blob: 43d97028c0fc8202b51a1ecdd6d83116ba3bbe9d [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
8 BGP stands for a Border Gateway Protocol. The lastest BGP version
9is 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.
11BGP-4 is described in @code{RFC1771} - @cite{A Border Gateway Protocol
124 (BGP-4)}.
13
14 Many extentions are added to @code{RFC1771}. @code{RFC2858} -
15@cite{Multiprotocol Extensions for BGP-4} provide multiprotocol
16support to BGP-4.
17
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::
34@end menu
35
paul76b89b42004-11-06 17:13:09 +000036@node Starting BGP
paul718e3742002-12-13 20:15:29 +000037@section Starting BGP
38
39Default configuration file of @command{bgpd} is @file{bgpd.conf}.
40@command{bgpd} searches the current directory first then
41@value{INSTALL_PREFIX_ETC}/bgpd.conf. All of bgpd's command must be
42configured in @file{bgpd.conf}.
43
44@command{bgpd} specific invocation options are described below. Common
45options may also be specified (@pxref{Common Invocation Options}).
46
47@table @samp
48@item -p @var{PORT}
49@itemx --bgp_port=@var{PORT}
50Set the bgp protocol's port number.
51
52@item -r
53@itemx --retain
54When program terminates, retain BGP routes added by zebra.
55@end table
56
paul76b89b42004-11-06 17:13:09 +000057@node BGP router
paul718e3742002-12-13 20:15:29 +000058@section BGP router
59
60 First of all you must configure BGP router with @command{router bgp}
61command. To configure BGP router, you need AS number. AS number is an
62identification of autonomous system. BGP protocol uses the AS number
63for detecting whether the BGP connection is internal one or external one.
64
65@deffn Command {router bgp @var{asn}} {}
66Enable a BGP protocol process with the specified @var{asn}. After
67this statement you can input any @code{BGP Commands}. You can not
68create different BGP process under different @var{asn} without
69specifying @code{multiple-instance} (@pxref{Multiple instance}).
70@end deffn
71
72@deffn Command {no router bgp @var{asn}} {}
73Destroy a BGP protocol process with the specified @var{asn}.
74@end deffn
75
76@deffn {BGP} {bgp router-id @var{A.B.C.D}} {}
77This command specifies the router-ID. If @command{bgpd} connects to @command{zebra} it gets
78interface and address information. In that case default router ID value
79is selected as the largest IP Address of the interfaces. When
80@code{router zebra} is not enabled @command{bgpd} can't get interface information
81so @code{router-id} is set to 0.0.0.0. So please set router-id by hand.
82@end deffn
83
84@menu
85* BGP distance::
86* BGP decision process::
87@end menu
88
paul76b89b42004-11-06 17:13:09 +000089@node BGP distance
paul718e3742002-12-13 20:15:29 +000090@subsection BGP distance
91
92@deffn {BGP} {distance bgp <1-255> <1-255> <1-255>} {}
93This command change distance value of BGP. Each argument is distance
94value for external routes, internal routes and local routes.
95@end deffn
96
97@deffn {BGP} {distance <1-255> @var{A.B.C.D/M}} {}
98@deffnx {BGP} {distance <1-255> @var{A.B.C.D/M} @var{word}} {}
99This command set distance value to
100@end deffn
101
paul76b89b42004-11-06 17:13:09 +0000102@node BGP decision process
paul718e3742002-12-13 20:15:29 +0000103@subsection BGP decision process
104
105@table @asis
106@item 1. Weight check
107
108@item 2. Local preference check.
109
110@item 3. Local route check.
111
112@item 4. AS path length check.
113
114@item 5. Origin check.
115
116@item 6. MED check.
117@end table
118
hasso68118452005-04-08 15:40:36 +0000119@deffn {BGP} {bgp bestpath as-path confed} {}
120This command specifies that the length of confederation path sets and
121sequences should should be taken into account during the BGP best path
122decision process.
123@end deffn
124
paul76b89b42004-11-06 17:13:09 +0000125@node BGP network
paul718e3742002-12-13 20:15:29 +0000126@section BGP network
127
128@menu
129* BGP route::
130* Route Aggregation::
131* Redistribute to BGP::
132@end menu
133
paul76b89b42004-11-06 17:13:09 +0000134@node BGP route
paul718e3742002-12-13 20:15:29 +0000135@subsection BGP route
136
137@deffn {BGP} {network @var{A.B.C.D/M}} {}
138This command adds the announcement network.
139@example
140@group
141router bgp 1
142 network 10.0.0.0/8
143@end group
144@end example
145This configuration example says that network 10.0.0.0/8 will be
146announced to all neighbors. Some vendors' routers don't advertise
147routes if they aren't present in their IGP routing tables; @code{bgp}
148doesn't care about IGP routes when announcing its routes.
149@end deffn
150
151@deffn {BGP} {no network @var{A.B.C.D/M}} {}
152@end deffn
153
paul76b89b42004-11-06 17:13:09 +0000154@node Route Aggregation
paul718e3742002-12-13 20:15:29 +0000155@subsection Route Aggregation
156
157@deffn {BGP} {aggregate-address @var{A.B.C.D/M}} {}
158This command specifies an aggregate address.
159@end deffn
160
161@deffn {BGP} {aggregate-address @var{A.B.C.D/M} as-set} {}
162This command specifies an aggregate address. Resulting routes inlucde
163AS set.
164@end deffn
165
166@deffn {BGP} {aggregate-address @var{A.B.C.D/M} summary-only} {}
167This command specifies an aggregate address. Aggreated routes will
168not be announce.
169@end deffn
170
171@deffn {BGP} {no aggregate-address @var{A.B.C.D/M}} {}
172@end deffn
173
paul76b89b42004-11-06 17:13:09 +0000174@node Redistribute to BGP
paul718e3742002-12-13 20:15:29 +0000175@subsection Redistribute to BGP
176
177@deffn {BGP} {redistribute kernel} {}
178Redistribute kernel route to BGP process.
179@end deffn
180
181@deffn {BGP} {redistribute static} {}
182Redistribute static route to BGP process.
183@end deffn
184
185@deffn {BGP} {redistribute connected} {}
186Redistribute connected route to BGP process.
187@end deffn
188
189@deffn {BGP} {redistribute rip} {}
190Redistribute RIP route to BGP process.
191@end deffn
192
193@deffn {BGP} {redistribute ospf} {}
194Redistribute OSPF route to BGP process.
195@end deffn
196
paul76b89b42004-11-06 17:13:09 +0000197@node BGP Peer
paul718e3742002-12-13 20:15:29 +0000198@section BGP Peer
199
200@menu
201* Defining Peer::
202* BGP Peer commands::
203* Peer filtering::
204@end menu
205
paul76b89b42004-11-06 17:13:09 +0000206@node Defining Peer
paul718e3742002-12-13 20:15:29 +0000207@subsection Defining Peer
208
209@deffn {BGP} {neighbor @var{peer} remote-as @var{asn}} {}
210Creates a new neighbor whose remote-as is @var{asn}. @var{peer}
211can be an IPv4 address or an IPv6 address.
212@example
213@group
214router bgp 1
215 neighbor 10.0.0.1 remote-as 2
216@end group
217@end example
218In this case my router, in AS-1, is trying to peer with AS-2 at
21910.0.0.1.
220
221This command must be the first command used when configuring a neighbor.
222If the remote-as is not specified, @command{bgpd} will complain like this:
223@example
224can't find neighbor 10.0.0.1
225@end example
226@end deffn
227
paul76b89b42004-11-06 17:13:09 +0000228@node BGP Peer commands
paul718e3742002-12-13 20:15:29 +0000229@subsection BGP Peer commands
230
231In a @code{router bgp} clause there are neighbor specific configurations
232required.
233
234@deffn {BGP} {neighbor @var{peer} shutdown} {}
235@deffnx {BGP} {no neighbor @var{peer} shutdown} {}
236Shutdown the peer. We can delete the neighbor's configuration by
237@code{no neighbor @var{peer} remote-as @var{as-number}} but all
238configuration of the neighbor will be deleted. When you want to
239preserve the configuration, but want to drop the BGP peer, use this
240syntax.
241@end deffn
242
243@deffn {BGP} {neighbor @var{peer} ebgp-multihop} {}
244@deffnx {BGP} {no neighbor @var{peer} ebgp-multihop} {}
245@end deffn
246
247@deffn {BGP} {neighbor @var{peer} description ...} {}
248@deffnx {BGP} {no neighbor @var{peer} description ...} {}
249Set description of the peer.
250@end deffn
251
252@deffn {BGP} {neighbor @var{peer} version @var{version}} {}
253Set up the neighbor's BGP version. @var{version} can be @var{4},
254@var{4+} or @var{4-}. BGP version @var{4} is the default value used for
255BGP peering. BGP version @var{4+} means that the neighbor supports
256Multiprotocol Extensions for BGP-4. BGP version @var{4-} is similar but
257the neighbor speaks the old Internet-Draft revision 00's Multiprotocol
258Extensions for BGP-4. Some routing software is still using this
259version.
260@end deffn
261
262@deffn {BGP} {neighbor @var{peer} interface @var{ifname}} {}
263@deffnx {BGP} {no neighbor @var{peer} interface @var{ifname}} {}
264When you connect to a BGP peer over an IPv6 link-local address, you have
265to specify the @var{ifname} of the interface used for the connection.
266@end deffn
267
268@deffn {BGP} {neighbor @var{peer} next-hop-self} {}
269@deffnx {BGP} {no neighbor @var{peer} next-hop-self} {}
270This command specifies an announced route's nexthop as being equivalent
271to the address of the bgp router.
272@end deffn
273
274@deffn {BGP} {neighbor @var{peer} update-source} {}
275@deffnx {BGP} {no neighbor @var{peer} update-source} {}
276@end deffn
277
278@deffn {BGP} {neighbor @var{peer} default-originate} {}
279@deffnx {BGP} {no neighbor @var{peer} default-originate} {}
280@command{bgpd}'s default is to not announce the default route (0.0.0.0/0) even it
281is in routing table. When you want to announce default routes to the
282peer, use this command.
283@end deffn
284
285@deffn {BGP} {neighbor @var{peer} port @var{port}} {}
286@deffnx {BGP} {neighbor @var{peer} port @var{port}} {}
287@end deffn
288
289@deffn {BGP} {neighbor @var{peer} send-community} {}
290@deffnx {BGP} {neighbor @var{peer} send-community} {}
291@end deffn
292
293@deffn {BGP} {neighbor @var{peer} weight @var{weight}} {}
294@deffnx {BGP} {no neighbor @var{peer} weight @var{weight}} {}
295This command specifies a default @var{weight} value for the neighbor's
296routes.
297@end deffn
298
299@deffn {BGP} {neighbor @var{peer} maximum-prefix @var{number}} {}
300@deffnx {BGP} {no neighbor @var{peer} maximum-prefix @var{number}} {}
301@end deffn
302
paul76b89b42004-11-06 17:13:09 +0000303@node Peer filtering
paul718e3742002-12-13 20:15:29 +0000304@subsection Peer filtering
305
306@deffn {BGP} {neighbor @var{peer} distribute-list @var{name} [in|out]} {}
307This command specifies a distribute-list for the peer. @var{direct} is
308@samp{in} or @samp{out}.
309@end deffn
310
311@deffn {BGP command} {neighbor @var{peer} prefix-list @var{name} [in|out]} {}
312@end deffn
313
314@deffn {BGP command} {neighbor @var{peer} filter-list @var{name} [in|out]} {}
315@end deffn
316
317@deffn {BGP} {neighbor @var{peer} route-map @var{name} [in|out]} {}
318Apply a route-map on the neighbor. @var{direct} must be @code{in} or
319@code{out}.
320@end deffn
321
322@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000323@node BGP Peer Group
paul718e3742002-12-13 20:15:29 +0000324@section BGP Peer Group
325
326@deffn {BGP} {neighbor @var{word} peer-group} {}
327This command defines a new peer group.
328@end deffn
329
330@deffn {BGP} {neighbor @var{peer} peer-group @var{word}} {}
331This command bind specific peer to peer group @var{word}.
332@end deffn
333
paul76b89b42004-11-06 17:13:09 +0000334@node BGP Address Family
paul718e3742002-12-13 20:15:29 +0000335@section BGP Address Family
336
paul718e3742002-12-13 20:15:29 +0000337@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000338@node Autonomous System
paul718e3742002-12-13 20:15:29 +0000339@section Autonomous System
340
341 AS (Autonomous System) is one of the essential element of BGP. BGP
342is a distance vector routing protocol. AS framework provides distance
343vector metric and loop detection to BGP. @code{RFC1930} -
344@cite{Guidelines for creation, selection, and registration of an
345Autonomous System (AS)} describes how to use AS.
346
347 AS number is tow octet digita value. So the value range is from 1
348to 65535. AS numbers 64512 through 65535 are defined as private AS
349numbers. Private AS numbers must not to be advertised in the global
350Internet.
351
352@menu
353* AS Path Regular Expression::
354* Display BGP Routes by AS Path::
355* AS Path Access List::
356* Using AS Path in Route Map::
357* Private AS Numbers::
358@end menu
359
paul76b89b42004-11-06 17:13:09 +0000360@node AS Path Regular Expression
paul718e3742002-12-13 20:15:29 +0000361@subsection AS Path Regular Expression
362
363 AS path regular expression can be used for displaying BGP routes and
364AS path access list. AS path regular expression is based on
365@code{POSIX 1003.2} regular expressions. Following description is
366just a subset of @code{POSIX} regular expression. User can use full
367@code{POSIX} regular expression. Adding to that special character '_'
368is added for AS path regular expression.
369
370@table @code
371@item .
372Matches any single character.
373@item *
374Matches 0 or more occurrences of pattern.
375@item +
376Matches 1 or more occurrences of pattern.
377@item ?
378Match 0 or 1 occurrences of pattern.
379@item ^
380Matches the beginning of the line.
381@item $
382Matches the end of the line.
383@item _
384Character @code{_} has special meanings in AS path regular expression.
385It matches to space and comma , and AS set delimiter @{ and @} and AS
386confederation delimiter @code{(} and @code{)}. And it also matches to
387the beginning of the line and the end of the line. So @code{_} can be
388used for AS value boundaries match. @code{show ip bgp regexp _7675_}
389matches to all of BGP routes which as AS number include @var{7675}.
390@end table
391
paul76b89b42004-11-06 17:13:09 +0000392@node Display BGP Routes by AS Path
paul718e3742002-12-13 20:15:29 +0000393@subsection Display BGP Routes by AS Path
394
395 To show BGP routes which has specific AS path information @code{show
396ip bgp} command can be used.
397
398@deffn Command {show ip bgp regexp @var{line}} {}
399This commands display BGP routes that matches AS path regular
400expression @var{line}.
401@end deffn
402
paul76b89b42004-11-06 17:13:09 +0000403@node AS Path Access List
paul718e3742002-12-13 20:15:29 +0000404@subsection AS Path Access List
405
406 AS path access list is user defined AS path.
407
408@deffn {Command} {ip as-path access-list @var{word} @{permit|deny@} @var{line}} {}
409This command defines a new AS path access list.
410@end deffn
411
412@deffn {Command} {no ip as-path access-list @var{word}} {}
413@deffnx {Command} {no ip as-path access-list @var{word} @{permit|deny@} @var{line}} {}
414@end deffn
415
paul76b89b42004-11-06 17:13:09 +0000416@node Using AS Path in Route Map
paul718e3742002-12-13 20:15:29 +0000417@subsection Using AS Path in Route Map
418
419@deffn {Route Map} {match as-path @var{word}} {}
420@end deffn
421
422@deffn {Route Map} {set as-path prepend @var{as-path}} {}
423@end deffn
424
paul76b89b42004-11-06 17:13:09 +0000425@node Private AS Numbers
paul718e3742002-12-13 20:15:29 +0000426@subsection Private AS Numbers
427
paul718e3742002-12-13 20:15:29 +0000428@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000429@node BGP Communities Attribute
paul718e3742002-12-13 20:15:29 +0000430@section BGP Communities Attribute
431
432 BGP communities attribute is widely used for implementing policy
433routing. Network operators can manipulate BGP communities attribute
434based on their network policy. BGP communities attribute is defined
435in @code{RFC1997} - @cite{BGP Communities Attribute} and
436@code{RFC1998} - @cite{An Application of the BGP Community Attribute
437in Multi-home Routing}. It is an optional transitive attribute,
438therefore local policy can travel through different autonomous system.
439
440 Communities attribute is a set of communities values. Each
441communities value is 4 octet long. The following format is used to
442define communities value.
443
444@table @code
445@item AS:VAL
446This format represents 4 octet communities value. @code{AS} is high
447order 2 octet in digit format. @code{VAL} is low order 2 octet in
448digit format. This format is useful to define AS oriented policy
449value. For example, @code{7675:80} can be used when AS 7675 wants to
450pass local policy value 80 to neighboring peer.
451@item internet
452@code{internet} represents well-known communities value 0.
453@item no-export
454@code{no-export} represents well-known communities value @code{NO_EXPORT}@*
455@r{(0xFFFFFF01)}. All routes carry this value must not be advertised
456to outside a BGP confederation boundary. If neighboring BGP peer is
457part of BGP confederation, the peer is considered as inside a BGP
458confederation boundary, so the route will be announced to the peer.
459@item no-advertise
460@code{no-advertise} represents well-known communities value
461@code{NO_ADVERTISE}@*@r{(0xFFFFFF02)}. All routes carry this value
462must not be advertise to other BGP peers.
463@item local-AS
464@code{local-AS} represents well-known communities value
465@code{NO_EXPORT_SUBCONFED} @r{(0xFFFFFF03)}. All routes carry this
466value must not be advertised to external BGP peers. Even if the
467neighboring router is part of confederation, it is considered as
468external BGP peer, so the route will not be announced to the peer.
469@end table
470
471 When BGP communities attribute is received, duplicated communities
472value in the communities attribute is ignored and each communities
473values are sorted in numerical order.
474
475@menu
476* BGP Community Lists::
477* Numbered BGP Community Lists::
478* BGP Community in Route Map::
479* Display BGP Routes by Community::
480* Using BGP Communities Attribute::
481@end menu
482
paul76b89b42004-11-06 17:13:09 +0000483@node BGP Community Lists
paul718e3742002-12-13 20:15:29 +0000484@subsection BGP Community Lists
485
486 BGP community list is a user defined BGP communites attribute list.
487BGP community list can be used for matching or manipulating BGP
488communities attribute in updates.
489
490 There are two types of community list. One is standard community
491list and another is expanded community list. Standard community list
492defines communities attribute. Expanded community list defines
493communities attribute string with regular expression. Standard
494community list is compiled into binary format when user define it.
495Standard community list will be directly compared to BGP communities
496attribute in BGP updates. Therefore the comparison is faster than
497expanded community list.
498
499@deffn Command {ip community-list standard @var{name} @{permit|deny@} @var{community}} {}
500This command defines a new standard community list. @var{community}
501is communities value. The @var{community} is compiled into community
502structure. We can define multiple community list under same name. In
503that case match will happen user defined order. Once the
504community list matches to communities attribute in BGP updates it
505return permit or deny by the community list definition. When there is
506no matched entry, deny will be returned. When @var{community} is
507empty it matches to any routes.
508@end deffn
509
510@deffn Command {ip community-list expanded @var{name} @{permit|deny@} @var{line}} {}
511This command defines a new expanded community list. @var{line} is a
512string expression of communities attribute. @var{line} can include
513regular expression to match communities attribute in BGP updates.
514@end deffn
515
516@deffn Command {no ip community-list @var{name}} {}
517@deffnx Command {no ip community-list standard @var{name}} {}
518@deffnx Command {no ip community-list expanded @var{name}} {}
519These commands delete community lists specified by @var{name}. All of
520community lists shares a single name space. So community lists can be
521removed simpley specifying community lists name.
522@end deffn
523
524@deffn {Command} {show ip community-list} {}
525@deffnx {Command} {show ip community-list @var{name}} {}
526This command display current community list information. When
527@var{name} is specified the specified community list's information is
528shown.
529
530@example
531# show ip community-list
532Named Community standard list CLIST
533 permit 7675:80 7675:100 no-export
534 deny internet
535Named Community expanded list EXPAND
536 permit :
537
538# show ip community-list CLIST
539Named Community standard list CLIST
540 permit 7675:80 7675:100 no-export
541 deny internet
542@end example
543@end deffn
544
paul76b89b42004-11-06 17:13:09 +0000545@node Numbered BGP Community Lists
paul718e3742002-12-13 20:15:29 +0000546@subsection Numbered BGP Community Lists
547
548 When number is used for BGP community list name, the number has
549special meanings. Community list number in the range from 1 and 99 is
550standard community list. Community list number in the range from 100
551to 199 is expanded community list. These community lists are called
552as numbered community lists. On the other hand normal community lists
553is called as named community lists.
554
555@deffn Command {ip community-list <1-99> @{permit|deny@} @var{community}} {}
556This command defines a new community list. <1-99> is standard
557community list number. Community list name within this range defines
558standard community list. When @var{community} is empty it matches to
559any routes.
560@end deffn
561
562@deffn Command {ip community-list <100-199> @{permit|deny@} @var{community}} {}
563This command defines a new community list. <100-199> is expanded
564community list number. Community list name within this range defines
565expanded community list.
566@end deffn
567
568@deffn Command {ip community-list @var{name} @{permit|deny@} @var{community}} {}
569When community list type is not specifed, the community list type is
570automatically detected. If @var{community} can be compiled into
571communities attribute, the community list is defined as a standard
572community list. Otherwise it is defined as an expanded community
573list. This feature is left for backward compability. Use of this
574feature is not recommended.
575@end deffn
576
paul76b89b42004-11-06 17:13:09 +0000577@node BGP Community in Route Map
paul718e3742002-12-13 20:15:29 +0000578@subsection BGP Community in Route Map
579
580 In Route Map (@pxref{Route Map}), we can match or set BGP
581communities attribute. Using this feature network operator can
582implement their network policy based on BGP communities attribute.
583
584 Following commands can be used in Route Map.
585
586@deffn {Route Map} {match community @var{word}} {}
587@deffnx {Route Map} {match community @var{word} exact-match} {}
588This command perform match to BGP updates using community list
589@var{word}. When the one of BGP communities value match to the one of
590communities value in community list, it is match. When
591@code{exact-match} keyword is spcified, match happen only when BGP
592updates have completely same communities value specified in the
593community list.
594@end deffn
595
596@deffn {Route Map} {set community none} {}
597@deffnx {Route Map} {set community @var{community}} {}
598@deffnx {Route Map} {set community @var{community} additive} {}
599This command manipulate communities value in BGP updates. When
600@code{none} is specified as communities value, it removes entire
601communities attribute from BGP updates. When @var{community} is not
602@code{none}, specified communities value is set to BGP updates. If
603BGP updates already has BGP communities value, the existing BGP
604communities value is replaced with specified @var{community} value.
605When @code{additive} keyword is specified, @var{community} is appended
606to the existing communities value.
607@end deffn
608
609@deffn {Route Map} {set comm-list @var{word} delete} {}
610This command remove communities value from BGP communities attribute.
611The @var{word} is community list name. When BGP route's communities
612value matches to the community list @var{word}, the communities value
613is removed. When all of communities value is removed eventually, the
614BGP update's communities attribute is completely removed.
615@end deffn
616
paul76b89b42004-11-06 17:13:09 +0000617@node Display BGP Routes by Community
paul718e3742002-12-13 20:15:29 +0000618@subsection Display BGP Routes by Community
619
620 To show BGP routes which has specific BGP communities attribute,
621@code{show ip bgp} command can be used. The @var{community} value and
622community list can be used for @code{show ip bgp} command.
623
624@deffn Command {show ip bgp community} {}
625@deffnx Command {show ip bgp community @var{community}} {}
626@deffnx Command {show ip bgp community @var{community} exact-match} {}
627@code{show ip bgp community} displays BGP routes which has communities
628attribute. When @var{community} is specified, BGP routes that matches
629@var{community} value is displayed. For this command, @code{internet}
630keyword can't be used for @var{community} value. When
631@code{exact-match} is specified, it display only routes that have an
632exact match.
633@end deffn
634
635@deffn Command {show ip bgp community-list @var{word}} {}
636@deffnx Command {show ip bgp community-list @var{word} exact-match} {}
637This commands display BGP routes that matches community list
638@var{word}. When @code{exact-match} is specified, display only routes
639that have an exact match.
640@end deffn
641
paul76b89b42004-11-06 17:13:09 +0000642@node Using BGP Communities Attribute
paul718e3742002-12-13 20:15:29 +0000643@subsection Using BGP Communities Attribute
644
645 Following configuration is the most typical usage of BGP communities
646attribute. AS 7675 provides upstream Internet connection to AS 100.
647When following configuration exists in AS 7675, AS 100 networks
648operator can set local preference in AS 7675 network by setting BGP
649communities attribute to the updates.
650
651@example
652router bgp 7675
653 neighbor 192.168.0.1 remote-as 100
654 neighbor 192.168.0.1 route-map RMAP in
655!
656ip community-list 70 permit 7675:70
657ip community-list 70 deny
658ip community-list 80 permit 7675:80
659ip community-list 80 deny
660ip community-list 90 permit 7675:90
661ip community-list 90 deny
662!
663route-map RMAP permit 10
664 match community 70
665 set local-preference 70
666!
667route-map RMAP permit 20
668 match community 80
669 set local-preference 80
670!
671route-map RMAP permit 30
672 match community 90
673 set local-preference 90
674@end example
675
676 Following configuration announce 10.0.0.0/8 from AS 100 to AS 7675.
677The route has communities value 7675:80 so when above configuration
678exists in AS 7675, announced route's local preference will be set to
679value 80.
680
681@example
682router bgp 100
683 network 10.0.0.0/8
684 neighbor 192.168.0.2 remote-as 7675
685 neighbor 192.168.0.2 route-map RMAP out
686!
687ip prefix-list PLIST permit 10.0.0.0/8
688!
689route-map RMAP permit 10
690 match ip address prefix-list PLIST
691 set community 7675:80
692@end example
693
694 Following configuration is an example of BGP route filtering using
695communities attribute. This configuration only permit BGP routes
696which has BGP communities value 0:80 or 0:90. Network operator can
697put special internal communities value at BGP border router, then
698limit the BGP routes announcement into the internal network.
699
700@example
701router bgp 7675
702 neighbor 192.168.0.1 remote-as 100
703 neighbor 192.168.0.1 route-map RMAP in
704!
705ip community-list 1 permit 0:80 0:90
706!
707route-map RMAP permit in
708 match community 1
709@end example
710
711 Following exmaple filter BGP routes which has communities value 1:1.
712When there is no match community-list returns deny. To avoid
713filtering all of routes, we need to define permit any at last.
714
715@example
716router bgp 7675
717 neighbor 192.168.0.1 remote-as 100
718 neighbor 192.168.0.1 route-map RMAP in
719!
720ip community-list standard FILTER deny 1:1
721ip community-list standard FILTER permit
722!
723route-map RMAP permit 10
724 match community FILTER
725@end example
726
727 Communities value keyword @code{internet} has special meanings in
728standard community lists. In below example @code{internet} act as
729match any. It matches all of BGP routes even if the route does not
730have communities attribute at all. So community list @code{INTERNET}
731is same as above example's @code{FILTER}.
732
733@example
734ip community-list standard INTERNET deny 1:1
735ip community-list standard INTERNET permit internet
736@end example
737
738 Following configuration is an example of communities value deletion.
739With this configuration communities value 100:1 and 100:2 is removed
740from BGP updates. For communities value deletion, only @code{permit}
741community-list is used. @code{deny} community-list is ignored.
742
743@example
744router bgp 7675
745 neighbor 192.168.0.1 remote-as 100
746 neighbor 192.168.0.1 route-map RMAP in
747!
748ip community-list standard DEL permit 100:1 100:2
749!
750route-map RMAP permit 10
751 set comm-list DEL delete
752@end example
753
754@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000755@node BGP Extended Communities Attribute
paul718e3742002-12-13 20:15:29 +0000756@section BGP Extended Communities Attribute
757
758 BGP extended communities attribute is introduced with MPLS VPN/BGP
759technology. MPLS VPN/BGP expands capability of network infrastructure
760to provide VPN functionality. At the same time it requires a new
761framework for policy routing. With BGP Extended Communities Attribute
762we can use Route Target or Site of Origin for implementing network
763policy for MPLS VPN/BGP.
764
765 BGP Extended Communities Attribute is similar to BGP Communities
766Attribute. It is an optional transitive attribute. BGP Extended
767Communities Attribute can carry multiple Extended Community value.
768Each Extended Community value is eight octet length.
769
770 BGP Extended Communities Attribute provides an extended range
771compared with BGP Communities Attribute. Adding to that there is a
772type field in each value to provides community space structure.
773
774 There are two format to define Extended Community value. One is AS
775based format the other is IP address based format.
776
777@table @code
778@item AS:VAL
779This is a format to define AS based Extended Community value.
780@code{AS} part is 2 octets Global Administrator subfield in Extended
781Community value. @code{VAL} part is 4 octets Local Administrator
782subfield. @code{7675:100} represents AS 7675 policy value 100.
783@item IP-Address:VAL
784This is a format to define IP address based Extended Community value.
785@code{IP-Address} part is 4 octets Global Administrator subfield.
786@code{VAL} part is 2 octets Local Administrator subfield.
787@code{10.0.0.1:100} represents
788@end table
789
790@menu
791* BGP Extended Community Lists::
792* BGP Extended Communities in Route Map::
793@end menu
794
paul76b89b42004-11-06 17:13:09 +0000795@node BGP Extended Community Lists
paul718e3742002-12-13 20:15:29 +0000796@subsection BGP Extended Community Lists
797
798 Expanded Community Lists is a user defined BGP Expanded Community
799Lists.
800
801@deffn Command {ip extcommunity-list standard @var{name} @{permit|deny@} @var{extcommunity}} {}
802This command defines a new standard extcommunity-list.
803@var{extcommunity} is extended communities value. The
804@var{extcommunity} is compiled into extended community structure. We
805can define multiple extcommunity-list under same name. In that case
806match will happen user defined order. Once the extcommunity-list
807matches to extended communities attribute in BGP updates it return
808permit or deny based upon the extcommunity-list definition. When
809there is no matched entry, deny will be returned. When
810@var{extcommunity} is empty it matches to any routes.
811@end deffn
812
813@deffn Command {ip extcommunity-list expanded @var{name} @{permit|deny@} @var{line}} {}
814This command defines a new expanded extcommunity-list. @var{line} is
815a string expression of extended communities attribute. @var{line} can
816include regular expression to match extended communities attribute in
817BGP updates.
818@end deffn
819
820@deffn Command {no ip extcommunity-list @var{name}} {}
821@deffnx Command {no ip extcommunity-list standard @var{name}} {}
822@deffnx Command {no ip extcommunity-list expanded @var{name}} {}
823These commands delete extended community lists specified by
824@var{name}. All of extended community lists shares a single name
825space. So extended community lists can be removed simpley specifying
826the name.
827@end deffn
828
829@deffn {Command} {show ip extcommunity-list} {}
830@deffnx {Command} {show ip extcommunity-list @var{name}} {}
831This command display current extcommunity-list information. When
832@var{name} is specified the community list's information is shown.
833
834@example
835# show ip extcommunity-list
836@end example
837@end deffn
838
paul76b89b42004-11-06 17:13:09 +0000839@node BGP Extended Communities in Route Map
paul718e3742002-12-13 20:15:29 +0000840@subsection BGP Extended Communities in Route Map
841
842@deffn {Route Map} {match extcommunity @var{word}} {}
843@end deffn
844
845@deffn {Route Map} {set extcommunity rt @var{extcommunity}} {}
846This command set Route Target value.
847@end deffn
848
849@deffn {Route Map} {set extcommunity soo @var{extcommunity}} {}
850This command set Site of Origin value.
851@end deffn
852
853@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000854@node Displaying BGP routes
paul718e3742002-12-13 20:15:29 +0000855@section Displaying BGP Routes
856
857@menu
858* Show IP BGP::
859* More Show IP BGP::
860@end menu
861
paul76b89b42004-11-06 17:13:09 +0000862@node Show IP BGP
paul718e3742002-12-13 20:15:29 +0000863@subsection Show IP BGP
864
865@deffn {Command} {show ip bgp} {}
866@deffnx {Command} {show ip bgp @var{A.B.C.D}} {}
867@deffnx {Command} {show ip bgp @var{X:X::X:X}} {}
868This command displays BGP routes. When no route is specified it
869display all of IPv4 BGP routes.
870@end deffn
871
872@example
873BGP table version is 0, local router ID is 10.1.1.1
874Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
875Origin codes: i - IGP, e - EGP, ? - incomplete
876
877 Network Next Hop Metric LocPrf Weight Path
878*> 1.1.1.1/32 0.0.0.0 0 32768 i
879
880Total number of prefixes 1
881@end example
882
paul76b89b42004-11-06 17:13:09 +0000883@node More Show IP BGP
paul718e3742002-12-13 20:15:29 +0000884@subsection More Show IP BGP
885
886@deffn {Command} {show ip bgp regexp @var{line}} {}
887This command display BGP routes using AS path regular expression (@pxref{Display BGP Routes by AS Path}).
888@end deffn
889
890@deffn Command {show ip bgp community @var{community}} {}
891@deffnx Command {show ip bgp community @var{community} exact-match} {}
892This command display BGP routes using @var{community} (@pxref{Display
893BGP Routes by Community}).
894@end deffn
895
896@deffn Command {show ip bgp community-list @var{word}} {}
897@deffnx Command {show ip bgp community-list @var{word} exact-match} {}
898This command display BGP routes using community list (@pxref{Display
899BGP Routes by Community}).
900@end deffn
901
902@deffn {Command} {show ip bgp summary} {}
903@end deffn
904
905@deffn {Command} {show ip bgp neighbor [@var{peer}]} {}
906@end deffn
907
908@deffn {Command} {clear ip bgp @var{peer}} {}
909Clear peers which have addresses of X.X.X.X
910@end deffn
911
912@deffn {Command} {clear ip bgp @var{peer} soft in} {}
913Clear peer using soft reconfiguration.
914@end deffn
915
916@deffn {Command} {show debug} {}
917@end deffn
918
919@deffn {Command} {debug event} {}
920@end deffn
921
922@deffn {Command} {debug update} {}
923@end deffn
924
925@deffn {Command} {debug keepalive} {}
926@end deffn
927
928@deffn {Command} {no debug event} {}
929@end deffn
930
931@deffn {Command} {no debug update} {}
932@end deffn
933
934@deffn {Command} {no debug keepalive} {}
935@end deffn
936
paul76b89b42004-11-06 17:13:09 +0000937@node Capability Negotiation
paul718e3742002-12-13 20:15:29 +0000938@section Capability Negotiation
939
940 When adding IPv6 routing information exchange feature to BGP. There
941were some proposals. @acronym{IETF} @acronym{IDR} working group finally
942take a proposal called Multiprotocol Extension for BGP. The
943specification is described in RFC2283. The protocol does not define new
944protocols. It defines new attributes to existing BGP. When it is used
945exchanging IPv6 routing information it is called BGP-4+. When it is
946used for exchanging multicast routing information it is called MBGP.
947
948 @command{bgpd} supports Multiprotocol Extension for BGP. So if remote peer
949supports the protocol, @command{bgpd} can exchange IPv6 and/or multicast routing
950information.
951
952 Traditional BGP does not have the feature to detect remote peer's
953capability whether it can handle other than IPv4 unicast routes. This
954is a big problem using Multiprotocol Extension for BGP to operational
955network. @cite{draft-ietf-idr-bgp4-cap-neg-04.txt} is proposing a
956feature called Capability Negotiation. @command{bgpd} use this Capability
957Negotiation to detect remote peer's capabilities. If the peer is only
958configured as IPv4 unicast neighbor, @command{bgpd} does not send these Capability
959Negotiation packets.
960
paul7190f4e2003-08-12 12:40:20 +0000961 By default, Quagga will bring up peering with minimal common capability
paul718e3742002-12-13 20:15:29 +0000962for the both sides. For example, local router has unicast and multicast
963capabilitie and remote router has unicast capability. In this case,
964the local router will establish the connection with unicast only capability.
paul7190f4e2003-08-12 12:40:20 +0000965When there are no common capabilities, Quagga sends Unsupported Capability
paul718e3742002-12-13 20:15:29 +0000966error and then resets the connection.
967
968 If you want to completely match capabilities with remote peer. Please
969use @command{strict-capability-match} command.
970
971@deffn {BGP} {neighbor @var{peer} strict-capability-match} {}
972@deffnx {BGP} {no neighbor @var{peer} strict-capability-match} {}
973Strictly compares remote capabilities and local capabilities. If capabilities
974are different, send Unsupported Capability error then reset connection.
975@end deffn
976
977 You may want to disable sending Capability Negotiation OPEN message
978optional parameter to the peer when remote peer does not implement
979Capability Negotiation. Please use @command{dont-capability-negotiate}
980command to disable the feature.
981
982@deffn {BGP} {neighbor @var{peer} dont-capability-negotiate} {}
983@deffnx {BGP} {no neighbor @var{peer} dont-capability-negotiate} {}
984Suppress sending Capability Negotiation as OPEN message optional
985parameter to the peer. This command only affects the peer is configured
986other than IPv4 unicast configuration.
987@end deffn
988
989 When remote peer does not have capability negotiation feature, remote
990peer will not send any capabilities at all. In that case, bgp configures
991the peer with configured capabilities.
992
993 You may prefer locally configured capabilities more than the negotiated
994capabilities even though remote peer sends capabilities. If the peer is
995configured by @command{override-capability}, @command{bgpd} ignores received
996capabilities then override negotiated capabilities with configured values.
997
998@deffn {BGP} {neighbor @var{peer} override-capability} {}
999@deffnx {BGP} {no neighbor @var{peer} override-capability} {}
1000Override the result of Capability Negotiation with local configuration.
1001Ignore remote peer's capability value.
1002@end deffn
1003
paul76b89b42004-11-06 17:13:09 +00001004@node Route Reflector
paul718e3742002-12-13 20:15:29 +00001005@section Route Reflector
1006
1007@deffn {BGP} {bgp cluster-id @var{a.b.c.d}} {}
1008@end deffn
1009
1010@deffn {BGP} {neighbor @var{peer} route-reflector-client} {}
1011@deffnx {BGP} {no neighbor @var{peer} route-reflector-client} {}
1012@end deffn
1013
paul76b89b42004-11-06 17:13:09 +00001014@node Route Server
paul718e3742002-12-13 20:15:29 +00001015@section Route Server
1016
1017At an Internet Exchange point, many ISPs are connected to each other by
1018external BGP peering. Normally these external BGP connection are done by
1019@code{full mesh} method. As with internal BGP full mesh formation,
1020this method has a scaling problem.
1021
1022This scaling problem is well known. Route Server is a method to resolve
1023the problem. Each ISP's BGP router only peers to Route Server. Route
1024Server serves as BGP information exchange to other BGP routers. By
1025applying this method, numbers of BGP connections is reduced from
1026O(n*(n-1)/2) to O(n).
1027
1028Unlike normal BGP router, Route Server must have several routing tables
1029for managing different routing policies for each BGP speaker. We call the
1030routing tables as different @code{view}s. @command{bgpd} can work as
1031normal BGP router or Route Server or both at the same time.
1032
1033@menu
1034* Multiple instance::
1035* BGP instance and view::
1036* Routing policy::
1037* Viewing the view::
1038@end menu
1039
paul76b89b42004-11-06 17:13:09 +00001040@node Multiple instance
paul718e3742002-12-13 20:15:29 +00001041@subsection Multiple instance
1042
1043To enable multiple view function of @code{bgpd}, you must turn on
1044multiple instance feature beforehand.
1045
1046@deffn {Command} {bgp multiple-instance} {}
1047Enable BGP multiple instance feature. After this feature is enabled,
1048you can make multiple BGP instances or multiple BGP views.
1049@end deffn
1050
1051@deffn {Command} {no bgp multiple-instance} {}
1052Disable BGP multiple instance feature. You can not disable this feature
1053when BGP multiple instances or views exist.
1054@end deffn
1055
1056When you want to make configuration more Cisco like one,
1057
1058@deffn {Command} {bgp config-type cisco} {}
1059Cisco compatible BGP configuration output.
1060@end deffn
1061
1062When bgp config-type cisco is specified,
1063
1064``no synchronization'' is displayed.
1065``no auto-summary'' is desplayed.
1066
1067``network'' and ``aggregate-address'' argument is displayed as
1068``A.B.C.D M.M.M.M''
1069
paul7190f4e2003-08-12 12:40:20 +00001070Quagga: network 10.0.0.0/8
paul718e3742002-12-13 20:15:29 +00001071Cisco: network 10.0.0.0
1072
paul7190f4e2003-08-12 12:40:20 +00001073Quagga: aggregate-address 192.168.0.0/24
paul718e3742002-12-13 20:15:29 +00001074Cisco: aggregate-address 192.168.0.0 255.255.255.0
1075
1076Community attribute handling is also different. If there is no
1077configuration is specified community attribute and extended community
1078attribute are sent to neighbor. When user manually disable the
1079feature community attribute is not sent to the neighbor. In case of
1080``bgp config-type cisco'' is specified, community attribute is not
1081sent to the neighbor by default. To send community attribute user has
1082to specify ``neighbor A.B.C.D send-community'' command.
1083
1084!
1085router bgp 1
1086 neighbor 10.0.0.1 remote-as 1
1087 no neighbor 10.0.0.1 send-community
1088!
1089
1090!
1091router bgp 1
1092 neighbor 10.0.0.1 remote-as 1
1093 neighbor 10.0.0.1 send-community
1094!
1095
1096@deffn {Command} {bgp config-type zebra} {}
paul7190f4e2003-08-12 12:40:20 +00001097Quagga style BGP configuration. This is default.
paul718e3742002-12-13 20:15:29 +00001098@end deffn
1099
paul76b89b42004-11-06 17:13:09 +00001100@node BGP instance and view
paul718e3742002-12-13 20:15:29 +00001101@subsection BGP instance and view
1102
1103BGP instance is a normal BGP process. The result of route selection
1104goes to the kernel routing table. You can setup different AS at the
1105same time when BGP multiple instance feature is enabled.
1106
1107@deffn {Command} {router bgp @var{as-number}} {}
1108Make a new BGP instance. You can use arbitrary word for the @var{name}.
1109@end deffn
1110
1111@example
1112@group
1113bgp multiple-instance
1114!
1115router bgp 1
1116 neighbor 10.0.0.1 remote-as 2
1117 neighbor 10.0.0.2 remote-as 3
1118!
1119router bgp 2
1120 neighbor 10.0.0.3 remote-as 4
1121 neighbor 10.0.0.4 remote-as 5
1122@end group
1123@end example
1124
1125BGP view is almost same as normal BGP process. The result of
1126route selection does not go to the kernel routing table. BGP view is
1127only for exchanging BGP routing information.
1128
1129@deffn {Command} {router bgp @var{as-number} view @var{name}} {}
1130Make a new BGP view. You can use arbitrary word for the @var{name}. This
1131view's route selection result does not go to the kernel routing table.
1132@end deffn
1133
1134With this command, you can setup Route Server like below.
1135
1136@example
1137@group
1138bgp multiple-instance
1139!
1140router bgp 1 view 1
1141 neighbor 10.0.0.1 remote-as 2
1142 neighbor 10.0.0.2 remote-as 3
1143!
1144router bgp 2 view 2
1145 neighbor 10.0.0.3 remote-as 4
1146 neighbor 10.0.0.4 remote-as 5
1147@end group
1148@end example
1149
paul76b89b42004-11-06 17:13:09 +00001150@node Routing policy
paul718e3742002-12-13 20:15:29 +00001151@subsection Routing policy
1152
1153You can set different routing policy for a peer. For example, you can
1154set different filter for a peer.
1155
1156@example
1157@group
1158bgp multiple-instance
1159!
1160router bgp 1 view 1
1161 neighbor 10.0.0.1 remote-as 2
1162 neighbor 10.0.0.1 distribute-list 1 in
1163!
1164router bgp 1 view 2
1165 neighbor 10.0.0.1 remote-as 2
1166 neighbor 10.0.0.1 distribute-list 2 in
1167@end group
1168@end example
1169
1170This means BGP update from a peer 10.0.0.1 goes to both BGP view 1 and view
11712. When the update is inserted into view 1, distribute-list 1 is
1172applied. On the other hand, when the update is inserted into view 2,
1173distribute-list 2 is applied.
1174
paul76b89b42004-11-06 17:13:09 +00001175@node Viewing the view
paul718e3742002-12-13 20:15:29 +00001176@subsection Viewing the view
1177
1178To display routing table of BGP view, you must specify view name.
1179
1180@deffn {Command} {show ip bgp view @var{name}} {}
1181Display routing table of BGP view @var{name}.
1182@end deffn
1183
paul76b89b42004-11-06 17:13:09 +00001184@node How to set up a 6-Bone connection
paul718e3742002-12-13 20:15:29 +00001185@section How to set up a 6-Bone connection
1186
paul6a22b1f2004-11-07 19:39:13 +00001187
paul718e3742002-12-13 20:15:29 +00001188@example
1189@group
1190zebra configuration
1191===================
1192!
1193! Actually there is no need to configure zebra
1194!
1195
1196bgpd configuration
1197==================
1198!
1199! This means that routes go through zebra and into the kernel.
1200!
1201router zebra
1202!
1203! MP-BGP configuration
1204!
1205router bgp 7675
1206 bgp router-id 10.0.0.1
1207 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 remote-as @var{as-number}
1208!
1209 address-family ipv6
1210 network 3ffe:506::/32
1211 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 activate
1212 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 route-map set-nexthop out
1213 neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 remote-as @var{as-number}
1214 neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 route-map set-nexthop out
1215 exit-address-family
1216!
1217ipv6 access-list all permit any
1218!
1219! Set output nexthop address.
1220!
1221route-map set-nexthop permit 10
1222 match ipv6 address all
1223 set ipv6 nexthop global 3ffe:1cfa:0:2:2c0:4fff:fe68:a225
1224 set ipv6 nexthop local fe80::2c0:4fff:fe68:a225
1225!
1226! logfile FILENAME is obsolete. Please use log file FILENAME
paul7190f4e2003-08-12 12:40:20 +00001227
paul718e3742002-12-13 20:15:29 +00001228log file bgpd.log
1229!
1230@end group
1231@end example
1232
paul76b89b42004-11-06 17:13:09 +00001233@node Dump BGP packets and table
paul718e3742002-12-13 20:15:29 +00001234@section Dump BGP packets and table
1235
1236@deffn Command {dump bgp all @var{path}} {}
1237@deffnx Command {dump bgp all @var{path} @var{interval}} {}
1238Dump all BGP packet and events to @var{path} file.
1239@end deffn
1240
1241@deffn Command {dump bgp updates @var{path}} {}
1242@deffnx Command {dump bgp updates @var{path} @var{interval}} {}
1243Dump BGP updates to @var{path} file.
1244@end deffn
1245
1246@deffn Command {dump bgp routes @var{path}} {}
1247@deffnx Command {dump bgp routes @var{path}} {}
1248Dump whole BGP routing table to @var{path}. This is heavy process.
1249@end deffn