blob: dab367c0a2bd9045529afa4a2f17e324dbbe4bd2 [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
paul76b89b42004-11-06 17:13:09 +0000119@node BGP network
paul718e3742002-12-13 20:15:29 +0000120@section BGP network
121
122@menu
123* BGP route::
124* Route Aggregation::
125* Redistribute to BGP::
126@end menu
127
paul76b89b42004-11-06 17:13:09 +0000128@node BGP route
paul718e3742002-12-13 20:15:29 +0000129@subsection BGP route
130
131@deffn {BGP} {network @var{A.B.C.D/M}} {}
132This command adds the announcement network.
133@example
134@group
135router bgp 1
136 network 10.0.0.0/8
137@end group
138@end example
139This configuration example says that network 10.0.0.0/8 will be
140announced to all neighbors. Some vendors' routers don't advertise
141routes if they aren't present in their IGP routing tables; @code{bgp}
142doesn't care about IGP routes when announcing its routes.
143@end deffn
144
145@deffn {BGP} {no network @var{A.B.C.D/M}} {}
146@end deffn
147
paul76b89b42004-11-06 17:13:09 +0000148@node Route Aggregation
paul718e3742002-12-13 20:15:29 +0000149@subsection Route Aggregation
150
151@deffn {BGP} {aggregate-address @var{A.B.C.D/M}} {}
152This command specifies an aggregate address.
153@end deffn
154
155@deffn {BGP} {aggregate-address @var{A.B.C.D/M} as-set} {}
156This command specifies an aggregate address. Resulting routes inlucde
157AS set.
158@end deffn
159
160@deffn {BGP} {aggregate-address @var{A.B.C.D/M} summary-only} {}
161This command specifies an aggregate address. Aggreated routes will
162not be announce.
163@end deffn
164
165@deffn {BGP} {no aggregate-address @var{A.B.C.D/M}} {}
166@end deffn
167
paul76b89b42004-11-06 17:13:09 +0000168@node Redistribute to BGP
paul718e3742002-12-13 20:15:29 +0000169@subsection Redistribute to BGP
170
171@deffn {BGP} {redistribute kernel} {}
172Redistribute kernel route to BGP process.
173@end deffn
174
175@deffn {BGP} {redistribute static} {}
176Redistribute static route to BGP process.
177@end deffn
178
179@deffn {BGP} {redistribute connected} {}
180Redistribute connected route to BGP process.
181@end deffn
182
183@deffn {BGP} {redistribute rip} {}
184Redistribute RIP route to BGP process.
185@end deffn
186
187@deffn {BGP} {redistribute ospf} {}
188Redistribute OSPF route to BGP process.
189@end deffn
190
paul76b89b42004-11-06 17:13:09 +0000191@node BGP Peer
paul718e3742002-12-13 20:15:29 +0000192@section BGP Peer
193
194@menu
195* Defining Peer::
196* BGP Peer commands::
197* Peer filtering::
198@end menu
199
paul76b89b42004-11-06 17:13:09 +0000200@node Defining Peer
paul718e3742002-12-13 20:15:29 +0000201@subsection Defining Peer
202
203@deffn {BGP} {neighbor @var{peer} remote-as @var{asn}} {}
204Creates a new neighbor whose remote-as is @var{asn}. @var{peer}
205can be an IPv4 address or an IPv6 address.
206@example
207@group
208router bgp 1
209 neighbor 10.0.0.1 remote-as 2
210@end group
211@end example
212In this case my router, in AS-1, is trying to peer with AS-2 at
21310.0.0.1.
214
215This command must be the first command used when configuring a neighbor.
216If the remote-as is not specified, @command{bgpd} will complain like this:
217@example
218can't find neighbor 10.0.0.1
219@end example
220@end deffn
221
paul76b89b42004-11-06 17:13:09 +0000222@node BGP Peer commands
paul718e3742002-12-13 20:15:29 +0000223@subsection BGP Peer commands
224
225In a @code{router bgp} clause there are neighbor specific configurations
226required.
227
228@deffn {BGP} {neighbor @var{peer} shutdown} {}
229@deffnx {BGP} {no neighbor @var{peer} shutdown} {}
230Shutdown the peer. We can delete the neighbor's configuration by
231@code{no neighbor @var{peer} remote-as @var{as-number}} but all
232configuration of the neighbor will be deleted. When you want to
233preserve the configuration, but want to drop the BGP peer, use this
234syntax.
235@end deffn
236
237@deffn {BGP} {neighbor @var{peer} ebgp-multihop} {}
238@deffnx {BGP} {no neighbor @var{peer} ebgp-multihop} {}
239@end deffn
240
241@deffn {BGP} {neighbor @var{peer} description ...} {}
242@deffnx {BGP} {no neighbor @var{peer} description ...} {}
243Set description of the peer.
244@end deffn
245
246@deffn {BGP} {neighbor @var{peer} version @var{version}} {}
247Set up the neighbor's BGP version. @var{version} can be @var{4},
248@var{4+} or @var{4-}. BGP version @var{4} is the default value used for
249BGP peering. BGP version @var{4+} means that the neighbor supports
250Multiprotocol Extensions for BGP-4. BGP version @var{4-} is similar but
251the neighbor speaks the old Internet-Draft revision 00's Multiprotocol
252Extensions for BGP-4. Some routing software is still using this
253version.
254@end deffn
255
256@deffn {BGP} {neighbor @var{peer} interface @var{ifname}} {}
257@deffnx {BGP} {no neighbor @var{peer} interface @var{ifname}} {}
258When you connect to a BGP peer over an IPv6 link-local address, you have
259to specify the @var{ifname} of the interface used for the connection.
260@end deffn
261
262@deffn {BGP} {neighbor @var{peer} next-hop-self} {}
263@deffnx {BGP} {no neighbor @var{peer} next-hop-self} {}
264This command specifies an announced route's nexthop as being equivalent
265to the address of the bgp router.
266@end deffn
267
268@deffn {BGP} {neighbor @var{peer} update-source} {}
269@deffnx {BGP} {no neighbor @var{peer} update-source} {}
270@end deffn
271
272@deffn {BGP} {neighbor @var{peer} default-originate} {}
273@deffnx {BGP} {no neighbor @var{peer} default-originate} {}
274@command{bgpd}'s default is to not announce the default route (0.0.0.0/0) even it
275is in routing table. When you want to announce default routes to the
276peer, use this command.
277@end deffn
278
279@deffn {BGP} {neighbor @var{peer} port @var{port}} {}
280@deffnx {BGP} {neighbor @var{peer} port @var{port}} {}
281@end deffn
282
283@deffn {BGP} {neighbor @var{peer} send-community} {}
284@deffnx {BGP} {neighbor @var{peer} send-community} {}
285@end deffn
286
287@deffn {BGP} {neighbor @var{peer} weight @var{weight}} {}
288@deffnx {BGP} {no neighbor @var{peer} weight @var{weight}} {}
289This command specifies a default @var{weight} value for the neighbor's
290routes.
291@end deffn
292
293@deffn {BGP} {neighbor @var{peer} maximum-prefix @var{number}} {}
294@deffnx {BGP} {no neighbor @var{peer} maximum-prefix @var{number}} {}
295@end deffn
296
paul76b89b42004-11-06 17:13:09 +0000297@node Peer filtering
paul718e3742002-12-13 20:15:29 +0000298@subsection Peer filtering
299
300@deffn {BGP} {neighbor @var{peer} distribute-list @var{name} [in|out]} {}
301This command specifies a distribute-list for the peer. @var{direct} is
302@samp{in} or @samp{out}.
303@end deffn
304
305@deffn {BGP command} {neighbor @var{peer} prefix-list @var{name} [in|out]} {}
306@end deffn
307
308@deffn {BGP command} {neighbor @var{peer} filter-list @var{name} [in|out]} {}
309@end deffn
310
311@deffn {BGP} {neighbor @var{peer} route-map @var{name} [in|out]} {}
312Apply a route-map on the neighbor. @var{direct} must be @code{in} or
313@code{out}.
314@end deffn
315
316@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000317@node BGP Peer Group
paul718e3742002-12-13 20:15:29 +0000318@section BGP Peer Group
319
320@deffn {BGP} {neighbor @var{word} peer-group} {}
321This command defines a new peer group.
322@end deffn
323
324@deffn {BGP} {neighbor @var{peer} peer-group @var{word}} {}
325This command bind specific peer to peer group @var{word}.
326@end deffn
327
paul76b89b42004-11-06 17:13:09 +0000328@node BGP Address Family
paul718e3742002-12-13 20:15:29 +0000329@section BGP Address Family
330
331
332
333@page
334@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000335@node Autonomous System
paul718e3742002-12-13 20:15:29 +0000336@section Autonomous System
337
338 AS (Autonomous System) is one of the essential element of BGP. BGP
339is a distance vector routing protocol. AS framework provides distance
340vector metric and loop detection to BGP. @code{RFC1930} -
341@cite{Guidelines for creation, selection, and registration of an
342Autonomous System (AS)} describes how to use AS.
343
344 AS number is tow octet digita value. So the value range is from 1
345to 65535. AS numbers 64512 through 65535 are defined as private AS
346numbers. Private AS numbers must not to be advertised in the global
347Internet.
348
349@menu
350* AS Path Regular Expression::
351* Display BGP Routes by AS Path::
352* AS Path Access List::
353* Using AS Path in Route Map::
354* Private AS Numbers::
355@end menu
356
paul76b89b42004-11-06 17:13:09 +0000357@node AS Path Regular Expression
paul718e3742002-12-13 20:15:29 +0000358@subsection AS Path Regular Expression
359
360 AS path regular expression can be used for displaying BGP routes and
361AS path access list. AS path regular expression is based on
362@code{POSIX 1003.2} regular expressions. Following description is
363just a subset of @code{POSIX} regular expression. User can use full
364@code{POSIX} regular expression. Adding to that special character '_'
365is added for AS path regular expression.
366
367@table @code
368@item .
369Matches any single character.
370@item *
371Matches 0 or more occurrences of pattern.
372@item +
373Matches 1 or more occurrences of pattern.
374@item ?
375Match 0 or 1 occurrences of pattern.
376@item ^
377Matches the beginning of the line.
378@item $
379Matches the end of the line.
380@item _
381Character @code{_} has special meanings in AS path regular expression.
382It matches to space and comma , and AS set delimiter @{ and @} and AS
383confederation delimiter @code{(} and @code{)}. And it also matches to
384the beginning of the line and the end of the line. So @code{_} can be
385used for AS value boundaries match. @code{show ip bgp regexp _7675_}
386matches to all of BGP routes which as AS number include @var{7675}.
387@end table
388
paul76b89b42004-11-06 17:13:09 +0000389@node Display BGP Routes by AS Path
paul718e3742002-12-13 20:15:29 +0000390@subsection Display BGP Routes by AS Path
391
392 To show BGP routes which has specific AS path information @code{show
393ip bgp} command can be used.
394
395@deffn Command {show ip bgp regexp @var{line}} {}
396This commands display BGP routes that matches AS path regular
397expression @var{line}.
398@end deffn
399
paul76b89b42004-11-06 17:13:09 +0000400@node AS Path Access List
paul718e3742002-12-13 20:15:29 +0000401@subsection AS Path Access List
402
403 AS path access list is user defined AS path.
404
405@deffn {Command} {ip as-path access-list @var{word} @{permit|deny@} @var{line}} {}
406This command defines a new AS path access list.
407@end deffn
408
409@deffn {Command} {no ip as-path access-list @var{word}} {}
410@deffnx {Command} {no ip as-path access-list @var{word} @{permit|deny@} @var{line}} {}
411@end deffn
412
paul76b89b42004-11-06 17:13:09 +0000413@node Using AS Path in Route Map
paul718e3742002-12-13 20:15:29 +0000414@subsection Using AS Path in Route Map
415
416@deffn {Route Map} {match as-path @var{word}} {}
417@end deffn
418
419@deffn {Route Map} {set as-path prepend @var{as-path}} {}
420@end deffn
421
paul76b89b42004-11-06 17:13:09 +0000422@node Private AS Numbers
paul718e3742002-12-13 20:15:29 +0000423@subsection Private AS Numbers
424
425@page
426@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000427@node BGP Communities Attribute
paul718e3742002-12-13 20:15:29 +0000428@section BGP Communities Attribute
429
430 BGP communities attribute is widely used for implementing policy
431routing. Network operators can manipulate BGP communities attribute
432based on their network policy. BGP communities attribute is defined
433in @code{RFC1997} - @cite{BGP Communities Attribute} and
434@code{RFC1998} - @cite{An Application of the BGP Community Attribute
435in Multi-home Routing}. It is an optional transitive attribute,
436therefore local policy can travel through different autonomous system.
437
438 Communities attribute is a set of communities values. Each
439communities value is 4 octet long. The following format is used to
440define communities value.
441
442@table @code
443@item AS:VAL
444This format represents 4 octet communities value. @code{AS} is high
445order 2 octet in digit format. @code{VAL} is low order 2 octet in
446digit format. This format is useful to define AS oriented policy
447value. For example, @code{7675:80} can be used when AS 7675 wants to
448pass local policy value 80 to neighboring peer.
449@item internet
450@code{internet} represents well-known communities value 0.
451@item no-export
452@code{no-export} represents well-known communities value @code{NO_EXPORT}@*
453@r{(0xFFFFFF01)}. All routes carry this value must not be advertised
454to outside a BGP confederation boundary. If neighboring BGP peer is
455part of BGP confederation, the peer is considered as inside a BGP
456confederation boundary, so the route will be announced to the peer.
457@item no-advertise
458@code{no-advertise} represents well-known communities value
459@code{NO_ADVERTISE}@*@r{(0xFFFFFF02)}. All routes carry this value
460must not be advertise to other BGP peers.
461@item local-AS
462@code{local-AS} represents well-known communities value
463@code{NO_EXPORT_SUBCONFED} @r{(0xFFFFFF03)}. All routes carry this
464value must not be advertised to external BGP peers. Even if the
465neighboring router is part of confederation, it is considered as
466external BGP peer, so the route will not be announced to the peer.
467@end table
468
469 When BGP communities attribute is received, duplicated communities
470value in the communities attribute is ignored and each communities
471values are sorted in numerical order.
472
473@menu
474* BGP Community Lists::
475* Numbered BGP Community Lists::
476* BGP Community in Route Map::
477* Display BGP Routes by Community::
478* Using BGP Communities Attribute::
479@end menu
480
paul76b89b42004-11-06 17:13:09 +0000481@node BGP Community Lists
paul718e3742002-12-13 20:15:29 +0000482@subsection BGP Community Lists
483
484 BGP community list is a user defined BGP communites attribute list.
485BGP community list can be used for matching or manipulating BGP
486communities attribute in updates.
487
488 There are two types of community list. One is standard community
489list and another is expanded community list. Standard community list
490defines communities attribute. Expanded community list defines
491communities attribute string with regular expression. Standard
492community list is compiled into binary format when user define it.
493Standard community list will be directly compared to BGP communities
494attribute in BGP updates. Therefore the comparison is faster than
495expanded community list.
496
497@deffn Command {ip community-list standard @var{name} @{permit|deny@} @var{community}} {}
498This command defines a new standard community list. @var{community}
499is communities value. The @var{community} is compiled into community
500structure. We can define multiple community list under same name. In
501that case match will happen user defined order. Once the
502community list matches to communities attribute in BGP updates it
503return permit or deny by the community list definition. When there is
504no matched entry, deny will be returned. When @var{community} is
505empty it matches to any routes.
506@end deffn
507
508@deffn Command {ip community-list expanded @var{name} @{permit|deny@} @var{line}} {}
509This command defines a new expanded community list. @var{line} is a
510string expression of communities attribute. @var{line} can include
511regular expression to match communities attribute in BGP updates.
512@end deffn
513
514@deffn Command {no ip community-list @var{name}} {}
515@deffnx Command {no ip community-list standard @var{name}} {}
516@deffnx Command {no ip community-list expanded @var{name}} {}
517These commands delete community lists specified by @var{name}. All of
518community lists shares a single name space. So community lists can be
519removed simpley specifying community lists name.
520@end deffn
521
522@deffn {Command} {show ip community-list} {}
523@deffnx {Command} {show ip community-list @var{name}} {}
524This command display current community list information. When
525@var{name} is specified the specified community list's information is
526shown.
527
528@example
529# show ip community-list
530Named Community standard list CLIST
531 permit 7675:80 7675:100 no-export
532 deny internet
533Named Community expanded list EXPAND
534 permit :
535
536# show ip community-list CLIST
537Named Community standard list CLIST
538 permit 7675:80 7675:100 no-export
539 deny internet
540@end example
541@end deffn
542
paul76b89b42004-11-06 17:13:09 +0000543@node Numbered BGP Community Lists
paul718e3742002-12-13 20:15:29 +0000544@subsection Numbered BGP Community Lists
545
546 When number is used for BGP community list name, the number has
547special meanings. Community list number in the range from 1 and 99 is
548standard community list. Community list number in the range from 100
549to 199 is expanded community list. These community lists are called
550as numbered community lists. On the other hand normal community lists
551is called as named community lists.
552
553@deffn Command {ip community-list <1-99> @{permit|deny@} @var{community}} {}
554This command defines a new community list. <1-99> is standard
555community list number. Community list name within this range defines
556standard community list. When @var{community} is empty it matches to
557any routes.
558@end deffn
559
560@deffn Command {ip community-list <100-199> @{permit|deny@} @var{community}} {}
561This command defines a new community list. <100-199> is expanded
562community list number. Community list name within this range defines
563expanded community list.
564@end deffn
565
566@deffn Command {ip community-list @var{name} @{permit|deny@} @var{community}} {}
567When community list type is not specifed, the community list type is
568automatically detected. If @var{community} can be compiled into
569communities attribute, the community list is defined as a standard
570community list. Otherwise it is defined as an expanded community
571list. This feature is left for backward compability. Use of this
572feature is not recommended.
573@end deffn
574
paul76b89b42004-11-06 17:13:09 +0000575@node BGP Community in Route Map
paul718e3742002-12-13 20:15:29 +0000576@subsection BGP Community in Route Map
577
578 In Route Map (@pxref{Route Map}), we can match or set BGP
579communities attribute. Using this feature network operator can
580implement their network policy based on BGP communities attribute.
581
582 Following commands can be used in Route Map.
583
584@deffn {Route Map} {match community @var{word}} {}
585@deffnx {Route Map} {match community @var{word} exact-match} {}
586This command perform match to BGP updates using community list
587@var{word}. When the one of BGP communities value match to the one of
588communities value in community list, it is match. When
589@code{exact-match} keyword is spcified, match happen only when BGP
590updates have completely same communities value specified in the
591community list.
592@end deffn
593
594@deffn {Route Map} {set community none} {}
595@deffnx {Route Map} {set community @var{community}} {}
596@deffnx {Route Map} {set community @var{community} additive} {}
597This command manipulate communities value in BGP updates. When
598@code{none} is specified as communities value, it removes entire
599communities attribute from BGP updates. When @var{community} is not
600@code{none}, specified communities value is set to BGP updates. If
601BGP updates already has BGP communities value, the existing BGP
602communities value is replaced with specified @var{community} value.
603When @code{additive} keyword is specified, @var{community} is appended
604to the existing communities value.
605@end deffn
606
607@deffn {Route Map} {set comm-list @var{word} delete} {}
608This command remove communities value from BGP communities attribute.
609The @var{word} is community list name. When BGP route's communities
610value matches to the community list @var{word}, the communities value
611is removed. When all of communities value is removed eventually, the
612BGP update's communities attribute is completely removed.
613@end deffn
614
paul76b89b42004-11-06 17:13:09 +0000615@node Display BGP Routes by Community
paul718e3742002-12-13 20:15:29 +0000616@subsection Display BGP Routes by Community
617
618 To show BGP routes which has specific BGP communities attribute,
619@code{show ip bgp} command can be used. The @var{community} value and
620community list can be used for @code{show ip bgp} command.
621
622@deffn Command {show ip bgp community} {}
623@deffnx Command {show ip bgp community @var{community}} {}
624@deffnx Command {show ip bgp community @var{community} exact-match} {}
625@code{show ip bgp community} displays BGP routes which has communities
626attribute. When @var{community} is specified, BGP routes that matches
627@var{community} value is displayed. For this command, @code{internet}
628keyword can't be used for @var{community} value. When
629@code{exact-match} is specified, it display only routes that have an
630exact match.
631@end deffn
632
633@deffn Command {show ip bgp community-list @var{word}} {}
634@deffnx Command {show ip bgp community-list @var{word} exact-match} {}
635This commands display BGP routes that matches community list
636@var{word}. When @code{exact-match} is specified, display only routes
637that have an exact match.
638@end deffn
639
paul76b89b42004-11-06 17:13:09 +0000640@node Using BGP Communities Attribute
paul718e3742002-12-13 20:15:29 +0000641@subsection Using BGP Communities Attribute
642
643 Following configuration is the most typical usage of BGP communities
644attribute. AS 7675 provides upstream Internet connection to AS 100.
645When following configuration exists in AS 7675, AS 100 networks
646operator can set local preference in AS 7675 network by setting BGP
647communities attribute to the updates.
648
649@example
650router bgp 7675
651 neighbor 192.168.0.1 remote-as 100
652 neighbor 192.168.0.1 route-map RMAP in
653!
654ip community-list 70 permit 7675:70
655ip community-list 70 deny
656ip community-list 80 permit 7675:80
657ip community-list 80 deny
658ip community-list 90 permit 7675:90
659ip community-list 90 deny
660!
661route-map RMAP permit 10
662 match community 70
663 set local-preference 70
664!
665route-map RMAP permit 20
666 match community 80
667 set local-preference 80
668!
669route-map RMAP permit 30
670 match community 90
671 set local-preference 90
672@end example
673
674 Following configuration announce 10.0.0.0/8 from AS 100 to AS 7675.
675The route has communities value 7675:80 so when above configuration
676exists in AS 7675, announced route's local preference will be set to
677value 80.
678
679@example
680router bgp 100
681 network 10.0.0.0/8
682 neighbor 192.168.0.2 remote-as 7675
683 neighbor 192.168.0.2 route-map RMAP out
684!
685ip prefix-list PLIST permit 10.0.0.0/8
686!
687route-map RMAP permit 10
688 match ip address prefix-list PLIST
689 set community 7675:80
690@end example
691
692 Following configuration is an example of BGP route filtering using
693communities attribute. This configuration only permit BGP routes
694which has BGP communities value 0:80 or 0:90. Network operator can
695put special internal communities value at BGP border router, then
696limit the BGP routes announcement into the internal network.
697
698@example
699router bgp 7675
700 neighbor 192.168.0.1 remote-as 100
701 neighbor 192.168.0.1 route-map RMAP in
702!
703ip community-list 1 permit 0:80 0:90
704!
705route-map RMAP permit in
706 match community 1
707@end example
708
709 Following exmaple filter BGP routes which has communities value 1:1.
710When there is no match community-list returns deny. To avoid
711filtering all of routes, we need to define permit any at last.
712
713@example
714router bgp 7675
715 neighbor 192.168.0.1 remote-as 100
716 neighbor 192.168.0.1 route-map RMAP in
717!
718ip community-list standard FILTER deny 1:1
719ip community-list standard FILTER permit
720!
721route-map RMAP permit 10
722 match community FILTER
723@end example
724
725 Communities value keyword @code{internet} has special meanings in
726standard community lists. In below example @code{internet} act as
727match any. It matches all of BGP routes even if the route does not
728have communities attribute at all. So community list @code{INTERNET}
729is same as above example's @code{FILTER}.
730
731@example
732ip community-list standard INTERNET deny 1:1
733ip community-list standard INTERNET permit internet
734@end example
735
736 Following configuration is an example of communities value deletion.
737With this configuration communities value 100:1 and 100:2 is removed
738from BGP updates. For communities value deletion, only @code{permit}
739community-list is used. @code{deny} community-list is ignored.
740
741@example
742router bgp 7675
743 neighbor 192.168.0.1 remote-as 100
744 neighbor 192.168.0.1 route-map RMAP in
745!
746ip community-list standard DEL permit 100:1 100:2
747!
748route-map RMAP permit 10
749 set comm-list DEL delete
750@end example
751
752@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000753@node BGP Extended Communities Attribute
paul718e3742002-12-13 20:15:29 +0000754@section BGP Extended Communities Attribute
755
756 BGP extended communities attribute is introduced with MPLS VPN/BGP
757technology. MPLS VPN/BGP expands capability of network infrastructure
758to provide VPN functionality. At the same time it requires a new
759framework for policy routing. With BGP Extended Communities Attribute
760we can use Route Target or Site of Origin for implementing network
761policy for MPLS VPN/BGP.
762
763 BGP Extended Communities Attribute is similar to BGP Communities
764Attribute. It is an optional transitive attribute. BGP Extended
765Communities Attribute can carry multiple Extended Community value.
766Each Extended Community value is eight octet length.
767
768 BGP Extended Communities Attribute provides an extended range
769compared with BGP Communities Attribute. Adding to that there is a
770type field in each value to provides community space structure.
771
772 There are two format to define Extended Community value. One is AS
773based format the other is IP address based format.
774
775@table @code
776@item AS:VAL
777This is a format to define AS based Extended Community value.
778@code{AS} part is 2 octets Global Administrator subfield in Extended
779Community value. @code{VAL} part is 4 octets Local Administrator
780subfield. @code{7675:100} represents AS 7675 policy value 100.
781@item IP-Address:VAL
782This is a format to define IP address based Extended Community value.
783@code{IP-Address} part is 4 octets Global Administrator subfield.
784@code{VAL} part is 2 octets Local Administrator subfield.
785@code{10.0.0.1:100} represents
786@end table
787
788@menu
789* BGP Extended Community Lists::
790* BGP Extended Communities in Route Map::
791@end menu
792
paul76b89b42004-11-06 17:13:09 +0000793@node BGP Extended Community Lists
paul718e3742002-12-13 20:15:29 +0000794@subsection BGP Extended Community Lists
795
796 Expanded Community Lists is a user defined BGP Expanded Community
797Lists.
798
799@deffn Command {ip extcommunity-list standard @var{name} @{permit|deny@} @var{extcommunity}} {}
800This command defines a new standard extcommunity-list.
801@var{extcommunity} is extended communities value. The
802@var{extcommunity} is compiled into extended community structure. We
803can define multiple extcommunity-list under same name. In that case
804match will happen user defined order. Once the extcommunity-list
805matches to extended communities attribute in BGP updates it return
806permit or deny based upon the extcommunity-list definition. When
807there is no matched entry, deny will be returned. When
808@var{extcommunity} is empty it matches to any routes.
809@end deffn
810
811@deffn Command {ip extcommunity-list expanded @var{name} @{permit|deny@} @var{line}} {}
812This command defines a new expanded extcommunity-list. @var{line} is
813a string expression of extended communities attribute. @var{line} can
814include regular expression to match extended communities attribute in
815BGP updates.
816@end deffn
817
818@deffn Command {no ip extcommunity-list @var{name}} {}
819@deffnx Command {no ip extcommunity-list standard @var{name}} {}
820@deffnx Command {no ip extcommunity-list expanded @var{name}} {}
821These commands delete extended community lists specified by
822@var{name}. All of extended community lists shares a single name
823space. So extended community lists can be removed simpley specifying
824the name.
825@end deffn
826
827@deffn {Command} {show ip extcommunity-list} {}
828@deffnx {Command} {show ip extcommunity-list @var{name}} {}
829This command display current extcommunity-list information. When
830@var{name} is specified the community list's information is shown.
831
832@example
833# show ip extcommunity-list
834@end example
835@end deffn
836
paul76b89b42004-11-06 17:13:09 +0000837@node BGP Extended Communities in Route Map
paul718e3742002-12-13 20:15:29 +0000838@subsection BGP Extended Communities in Route Map
839
840@deffn {Route Map} {match extcommunity @var{word}} {}
841@end deffn
842
843@deffn {Route Map} {set extcommunity rt @var{extcommunity}} {}
844This command set Route Target value.
845@end deffn
846
847@deffn {Route Map} {set extcommunity soo @var{extcommunity}} {}
848This command set Site of Origin value.
849@end deffn
850
851@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000852@node Displaying BGP routes
paul718e3742002-12-13 20:15:29 +0000853@section Displaying BGP Routes
854
855@menu
856* Show IP BGP::
857* More Show IP BGP::
858@end menu
859
paul76b89b42004-11-06 17:13:09 +0000860@node Show IP BGP
paul718e3742002-12-13 20:15:29 +0000861@subsection Show IP BGP
862
863@deffn {Command} {show ip bgp} {}
864@deffnx {Command} {show ip bgp @var{A.B.C.D}} {}
865@deffnx {Command} {show ip bgp @var{X:X::X:X}} {}
866This command displays BGP routes. When no route is specified it
867display all of IPv4 BGP routes.
868@end deffn
869
870@example
871BGP table version is 0, local router ID is 10.1.1.1
872Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
873Origin codes: i - IGP, e - EGP, ? - incomplete
874
875 Network Next Hop Metric LocPrf Weight Path
876*> 1.1.1.1/32 0.0.0.0 0 32768 i
877
878Total number of prefixes 1
879@end example
880
paul76b89b42004-11-06 17:13:09 +0000881@node More Show IP BGP
paul718e3742002-12-13 20:15:29 +0000882@subsection More Show IP BGP
883
884@deffn {Command} {show ip bgp regexp @var{line}} {}
885This command display BGP routes using AS path regular expression (@pxref{Display BGP Routes by AS Path}).
886@end deffn
887
888@deffn Command {show ip bgp community @var{community}} {}
889@deffnx Command {show ip bgp community @var{community} exact-match} {}
890This command display BGP routes using @var{community} (@pxref{Display
891BGP Routes by Community}).
892@end deffn
893
894@deffn Command {show ip bgp community-list @var{word}} {}
895@deffnx Command {show ip bgp community-list @var{word} exact-match} {}
896This command display BGP routes using community list (@pxref{Display
897BGP Routes by Community}).
898@end deffn
899
900@deffn {Command} {show ip bgp summary} {}
901@end deffn
902
903@deffn {Command} {show ip bgp neighbor [@var{peer}]} {}
904@end deffn
905
906@deffn {Command} {clear ip bgp @var{peer}} {}
907Clear peers which have addresses of X.X.X.X
908@end deffn
909
910@deffn {Command} {clear ip bgp @var{peer} soft in} {}
911Clear peer using soft reconfiguration.
912@end deffn
913
914@deffn {Command} {show debug} {}
915@end deffn
916
917@deffn {Command} {debug event} {}
918@end deffn
919
920@deffn {Command} {debug update} {}
921@end deffn
922
923@deffn {Command} {debug keepalive} {}
924@end deffn
925
926@deffn {Command} {no debug event} {}
927@end deffn
928
929@deffn {Command} {no debug update} {}
930@end deffn
931
932@deffn {Command} {no debug keepalive} {}
933@end deffn
934
paul76b89b42004-11-06 17:13:09 +0000935@node Capability Negotiation
paul718e3742002-12-13 20:15:29 +0000936@section Capability Negotiation
937
938 When adding IPv6 routing information exchange feature to BGP. There
939were some proposals. @acronym{IETF} @acronym{IDR} working group finally
940take a proposal called Multiprotocol Extension for BGP. The
941specification is described in RFC2283. The protocol does not define new
942protocols. It defines new attributes to existing BGP. When it is used
943exchanging IPv6 routing information it is called BGP-4+. When it is
944used for exchanging multicast routing information it is called MBGP.
945
946 @command{bgpd} supports Multiprotocol Extension for BGP. So if remote peer
947supports the protocol, @command{bgpd} can exchange IPv6 and/or multicast routing
948information.
949
950 Traditional BGP does not have the feature to detect remote peer's
951capability whether it can handle other than IPv4 unicast routes. This
952is a big problem using Multiprotocol Extension for BGP to operational
953network. @cite{draft-ietf-idr-bgp4-cap-neg-04.txt} is proposing a
954feature called Capability Negotiation. @command{bgpd} use this Capability
955Negotiation to detect remote peer's capabilities. If the peer is only
956configured as IPv4 unicast neighbor, @command{bgpd} does not send these Capability
957Negotiation packets.
958
paul7190f4e2003-08-12 12:40:20 +0000959 By default, Quagga will bring up peering with minimal common capability
paul718e3742002-12-13 20:15:29 +0000960for the both sides. For example, local router has unicast and multicast
961capabilitie and remote router has unicast capability. In this case,
962the local router will establish the connection with unicast only capability.
paul7190f4e2003-08-12 12:40:20 +0000963When there are no common capabilities, Quagga sends Unsupported Capability
paul718e3742002-12-13 20:15:29 +0000964error and then resets the connection.
965
966 If you want to completely match capabilities with remote peer. Please
967use @command{strict-capability-match} command.
968
969@deffn {BGP} {neighbor @var{peer} strict-capability-match} {}
970@deffnx {BGP} {no neighbor @var{peer} strict-capability-match} {}
971Strictly compares remote capabilities and local capabilities. If capabilities
972are different, send Unsupported Capability error then reset connection.
973@end deffn
974
975 You may want to disable sending Capability Negotiation OPEN message
976optional parameter to the peer when remote peer does not implement
977Capability Negotiation. Please use @command{dont-capability-negotiate}
978command to disable the feature.
979
980@deffn {BGP} {neighbor @var{peer} dont-capability-negotiate} {}
981@deffnx {BGP} {no neighbor @var{peer} dont-capability-negotiate} {}
982Suppress sending Capability Negotiation as OPEN message optional
983parameter to the peer. This command only affects the peer is configured
984other than IPv4 unicast configuration.
985@end deffn
986
987 When remote peer does not have capability negotiation feature, remote
988peer will not send any capabilities at all. In that case, bgp configures
989the peer with configured capabilities.
990
991 You may prefer locally configured capabilities more than the negotiated
992capabilities even though remote peer sends capabilities. If the peer is
993configured by @command{override-capability}, @command{bgpd} ignores received
994capabilities then override negotiated capabilities with configured values.
995
996@deffn {BGP} {neighbor @var{peer} override-capability} {}
997@deffnx {BGP} {no neighbor @var{peer} override-capability} {}
998Override the result of Capability Negotiation with local configuration.
999Ignore remote peer's capability value.
1000@end deffn
1001
paul76b89b42004-11-06 17:13:09 +00001002@node Route Reflector
paul718e3742002-12-13 20:15:29 +00001003@section Route Reflector
1004
1005@deffn {BGP} {bgp cluster-id @var{a.b.c.d}} {}
1006@end deffn
1007
1008@deffn {BGP} {neighbor @var{peer} route-reflector-client} {}
1009@deffnx {BGP} {no neighbor @var{peer} route-reflector-client} {}
1010@end deffn
1011
paul76b89b42004-11-06 17:13:09 +00001012@node Route Server
paul718e3742002-12-13 20:15:29 +00001013@section Route Server
1014
1015At an Internet Exchange point, many ISPs are connected to each other by
1016external BGP peering. Normally these external BGP connection are done by
1017@code{full mesh} method. As with internal BGP full mesh formation,
1018this method has a scaling problem.
1019
1020This scaling problem is well known. Route Server is a method to resolve
1021the problem. Each ISP's BGP router only peers to Route Server. Route
1022Server serves as BGP information exchange to other BGP routers. By
1023applying this method, numbers of BGP connections is reduced from
1024O(n*(n-1)/2) to O(n).
1025
1026Unlike normal BGP router, Route Server must have several routing tables
1027for managing different routing policies for each BGP speaker. We call the
1028routing tables as different @code{view}s. @command{bgpd} can work as
1029normal BGP router or Route Server or both at the same time.
1030
1031@menu
1032* Multiple instance::
1033* BGP instance and view::
1034* Routing policy::
1035* Viewing the view::
1036@end menu
1037
paul76b89b42004-11-06 17:13:09 +00001038@node Multiple instance
paul718e3742002-12-13 20:15:29 +00001039@subsection Multiple instance
1040
1041To enable multiple view function of @code{bgpd}, you must turn on
1042multiple instance feature beforehand.
1043
1044@deffn {Command} {bgp multiple-instance} {}
1045Enable BGP multiple instance feature. After this feature is enabled,
1046you can make multiple BGP instances or multiple BGP views.
1047@end deffn
1048
1049@deffn {Command} {no bgp multiple-instance} {}
1050Disable BGP multiple instance feature. You can not disable this feature
1051when BGP multiple instances or views exist.
1052@end deffn
1053
1054When you want to make configuration more Cisco like one,
1055
1056@deffn {Command} {bgp config-type cisco} {}
1057Cisco compatible BGP configuration output.
1058@end deffn
1059
1060When bgp config-type cisco is specified,
1061
1062``no synchronization'' is displayed.
1063``no auto-summary'' is desplayed.
1064
1065``network'' and ``aggregate-address'' argument is displayed as
1066``A.B.C.D M.M.M.M''
1067
paul7190f4e2003-08-12 12:40:20 +00001068Quagga: network 10.0.0.0/8
paul718e3742002-12-13 20:15:29 +00001069Cisco: network 10.0.0.0
1070
paul7190f4e2003-08-12 12:40:20 +00001071Quagga: aggregate-address 192.168.0.0/24
paul718e3742002-12-13 20:15:29 +00001072Cisco: aggregate-address 192.168.0.0 255.255.255.0
1073
1074Community attribute handling is also different. If there is no
1075configuration is specified community attribute and extended community
1076attribute are sent to neighbor. When user manually disable the
1077feature community attribute is not sent to the neighbor. In case of
1078``bgp config-type cisco'' is specified, community attribute is not
1079sent to the neighbor by default. To send community attribute user has
1080to specify ``neighbor A.B.C.D send-community'' command.
1081
1082!
1083router bgp 1
1084 neighbor 10.0.0.1 remote-as 1
1085 no neighbor 10.0.0.1 send-community
1086!
1087
1088!
1089router bgp 1
1090 neighbor 10.0.0.1 remote-as 1
1091 neighbor 10.0.0.1 send-community
1092!
1093
1094@deffn {Command} {bgp config-type zebra} {}
paul7190f4e2003-08-12 12:40:20 +00001095Quagga style BGP configuration. This is default.
paul718e3742002-12-13 20:15:29 +00001096@end deffn
1097
paul76b89b42004-11-06 17:13:09 +00001098@node BGP instance and view
paul718e3742002-12-13 20:15:29 +00001099@subsection BGP instance and view
1100
1101BGP instance is a normal BGP process. The result of route selection
1102goes to the kernel routing table. You can setup different AS at the
1103same time when BGP multiple instance feature is enabled.
1104
1105@deffn {Command} {router bgp @var{as-number}} {}
1106Make a new BGP instance. You can use arbitrary word for the @var{name}.
1107@end deffn
1108
1109@example
1110@group
1111bgp multiple-instance
1112!
1113router bgp 1
1114 neighbor 10.0.0.1 remote-as 2
1115 neighbor 10.0.0.2 remote-as 3
1116!
1117router bgp 2
1118 neighbor 10.0.0.3 remote-as 4
1119 neighbor 10.0.0.4 remote-as 5
1120@end group
1121@end example
1122
1123BGP view is almost same as normal BGP process. The result of
1124route selection does not go to the kernel routing table. BGP view is
1125only for exchanging BGP routing information.
1126
1127@deffn {Command} {router bgp @var{as-number} view @var{name}} {}
1128Make a new BGP view. You can use arbitrary word for the @var{name}. This
1129view's route selection result does not go to the kernel routing table.
1130@end deffn
1131
1132With this command, you can setup Route Server like below.
1133
1134@example
1135@group
1136bgp multiple-instance
1137!
1138router bgp 1 view 1
1139 neighbor 10.0.0.1 remote-as 2
1140 neighbor 10.0.0.2 remote-as 3
1141!
1142router bgp 2 view 2
1143 neighbor 10.0.0.3 remote-as 4
1144 neighbor 10.0.0.4 remote-as 5
1145@end group
1146@end example
1147
paul76b89b42004-11-06 17:13:09 +00001148@node Routing policy
paul718e3742002-12-13 20:15:29 +00001149@subsection Routing policy
1150
1151You can set different routing policy for a peer. For example, you can
1152set different filter for a peer.
1153
1154@example
1155@group
1156bgp multiple-instance
1157!
1158router bgp 1 view 1
1159 neighbor 10.0.0.1 remote-as 2
1160 neighbor 10.0.0.1 distribute-list 1 in
1161!
1162router bgp 1 view 2
1163 neighbor 10.0.0.1 remote-as 2
1164 neighbor 10.0.0.1 distribute-list 2 in
1165@end group
1166@end example
1167
1168This means BGP update from a peer 10.0.0.1 goes to both BGP view 1 and view
11692. When the update is inserted into view 1, distribute-list 1 is
1170applied. On the other hand, when the update is inserted into view 2,
1171distribute-list 2 is applied.
1172
paul76b89b42004-11-06 17:13:09 +00001173@node Viewing the view
paul718e3742002-12-13 20:15:29 +00001174@subsection Viewing the view
1175
1176To display routing table of BGP view, you must specify view name.
1177
1178@deffn {Command} {show ip bgp view @var{name}} {}
1179Display routing table of BGP view @var{name}.
1180@end deffn
1181
paul76b89b42004-11-06 17:13:09 +00001182@node How to set up a 6-Bone connection
paul718e3742002-12-13 20:15:29 +00001183@section How to set up a 6-Bone connection
1184
1185@example
1186@group
1187zebra configuration
1188===================
1189!
1190! Actually there is no need to configure zebra
1191!
1192
1193bgpd configuration
1194==================
1195!
1196! This means that routes go through zebra and into the kernel.
1197!
1198router zebra
1199!
1200! MP-BGP configuration
1201!
1202router bgp 7675
1203 bgp router-id 10.0.0.1
1204 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 remote-as @var{as-number}
1205!
1206 address-family ipv6
1207 network 3ffe:506::/32
1208 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 activate
1209 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 route-map set-nexthop out
1210 neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 remote-as @var{as-number}
1211 neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 route-map set-nexthop out
1212 exit-address-family
1213!
1214ipv6 access-list all permit any
1215!
1216! Set output nexthop address.
1217!
1218route-map set-nexthop permit 10
1219 match ipv6 address all
1220 set ipv6 nexthop global 3ffe:1cfa:0:2:2c0:4fff:fe68:a225
1221 set ipv6 nexthop local fe80::2c0:4fff:fe68:a225
1222!
1223! logfile FILENAME is obsolete. Please use log file FILENAME
paul7190f4e2003-08-12 12:40:20 +00001224
paul718e3742002-12-13 20:15:29 +00001225log file bgpd.log
1226!
1227@end group
1228@end example
1229
paul76b89b42004-11-06 17:13:09 +00001230@node Dump BGP packets and table
paul718e3742002-12-13 20:15:29 +00001231@section Dump BGP packets and table
1232
1233@deffn Command {dump bgp all @var{path}} {}
1234@deffnx Command {dump bgp all @var{path} @var{interval}} {}
1235Dump all BGP packet and events to @var{path} file.
1236@end deffn
1237
1238@deffn Command {dump bgp updates @var{path}} {}
1239@deffnx Command {dump bgp updates @var{path} @var{interval}} {}
1240Dump BGP updates to @var{path} file.
1241@end deffn
1242
1243@deffn Command {dump bgp routes @var{path}} {}
1244@deffnx Command {dump bgp routes @var{path}} {}
1245Dump whole BGP routing table to @var{path}. This is heavy process.
1246@end deffn