blob: 0e0a2708a0f2327242345d3e02f17f062bcb4bd4 [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
paul718e3742002-12-13 20:15:29 +0000331@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000332@node Autonomous System
paul718e3742002-12-13 20:15:29 +0000333@section Autonomous System
334
335 AS (Autonomous System) is one of the essential element of BGP. BGP
336is a distance vector routing protocol. AS framework provides distance
337vector metric and loop detection to BGP. @code{RFC1930} -
338@cite{Guidelines for creation, selection, and registration of an
339Autonomous System (AS)} describes how to use AS.
340
341 AS number is tow octet digita value. So the value range is from 1
342to 65535. AS numbers 64512 through 65535 are defined as private AS
343numbers. Private AS numbers must not to be advertised in the global
344Internet.
345
346@menu
347* AS Path Regular Expression::
348* Display BGP Routes by AS Path::
349* AS Path Access List::
350* Using AS Path in Route Map::
351* Private AS Numbers::
352@end menu
353
paul76b89b42004-11-06 17:13:09 +0000354@node AS Path Regular Expression
paul718e3742002-12-13 20:15:29 +0000355@subsection AS Path Regular Expression
356
357 AS path regular expression can be used for displaying BGP routes and
358AS path access list. AS path regular expression is based on
359@code{POSIX 1003.2} regular expressions. Following description is
360just a subset of @code{POSIX} regular expression. User can use full
361@code{POSIX} regular expression. Adding to that special character '_'
362is added for AS path regular expression.
363
364@table @code
365@item .
366Matches any single character.
367@item *
368Matches 0 or more occurrences of pattern.
369@item +
370Matches 1 or more occurrences of pattern.
371@item ?
372Match 0 or 1 occurrences of pattern.
373@item ^
374Matches the beginning of the line.
375@item $
376Matches the end of the line.
377@item _
378Character @code{_} has special meanings in AS path regular expression.
379It matches to space and comma , and AS set delimiter @{ and @} and AS
380confederation delimiter @code{(} and @code{)}. And it also matches to
381the beginning of the line and the end of the line. So @code{_} can be
382used for AS value boundaries match. @code{show ip bgp regexp _7675_}
383matches to all of BGP routes which as AS number include @var{7675}.
384@end table
385
paul76b89b42004-11-06 17:13:09 +0000386@node Display BGP Routes by AS Path
paul718e3742002-12-13 20:15:29 +0000387@subsection Display BGP Routes by AS Path
388
389 To show BGP routes which has specific AS path information @code{show
390ip bgp} command can be used.
391
392@deffn Command {show ip bgp regexp @var{line}} {}
393This commands display BGP routes that matches AS path regular
394expression @var{line}.
395@end deffn
396
paul76b89b42004-11-06 17:13:09 +0000397@node AS Path Access List
paul718e3742002-12-13 20:15:29 +0000398@subsection AS Path Access List
399
400 AS path access list is user defined AS path.
401
402@deffn {Command} {ip as-path access-list @var{word} @{permit|deny@} @var{line}} {}
403This command defines a new AS path access list.
404@end deffn
405
406@deffn {Command} {no ip as-path access-list @var{word}} {}
407@deffnx {Command} {no ip as-path access-list @var{word} @{permit|deny@} @var{line}} {}
408@end deffn
409
paul76b89b42004-11-06 17:13:09 +0000410@node Using AS Path in Route Map
paul718e3742002-12-13 20:15:29 +0000411@subsection Using AS Path in Route Map
412
413@deffn {Route Map} {match as-path @var{word}} {}
414@end deffn
415
416@deffn {Route Map} {set as-path prepend @var{as-path}} {}
417@end deffn
418
paul76b89b42004-11-06 17:13:09 +0000419@node Private AS Numbers
paul718e3742002-12-13 20:15:29 +0000420@subsection Private AS Numbers
421
paul718e3742002-12-13 20:15:29 +0000422@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000423@node BGP Communities Attribute
paul718e3742002-12-13 20:15:29 +0000424@section BGP Communities Attribute
425
426 BGP communities attribute is widely used for implementing policy
427routing. Network operators can manipulate BGP communities attribute
428based on their network policy. BGP communities attribute is defined
429in @code{RFC1997} - @cite{BGP Communities Attribute} and
430@code{RFC1998} - @cite{An Application of the BGP Community Attribute
431in Multi-home Routing}. It is an optional transitive attribute,
432therefore local policy can travel through different autonomous system.
433
434 Communities attribute is a set of communities values. Each
435communities value is 4 octet long. The following format is used to
436define communities value.
437
438@table @code
439@item AS:VAL
440This format represents 4 octet communities value. @code{AS} is high
441order 2 octet in digit format. @code{VAL} is low order 2 octet in
442digit format. This format is useful to define AS oriented policy
443value. For example, @code{7675:80} can be used when AS 7675 wants to
444pass local policy value 80 to neighboring peer.
445@item internet
446@code{internet} represents well-known communities value 0.
447@item no-export
448@code{no-export} represents well-known communities value @code{NO_EXPORT}@*
449@r{(0xFFFFFF01)}. All routes carry this value must not be advertised
450to outside a BGP confederation boundary. If neighboring BGP peer is
451part of BGP confederation, the peer is considered as inside a BGP
452confederation boundary, so the route will be announced to the peer.
453@item no-advertise
454@code{no-advertise} represents well-known communities value
455@code{NO_ADVERTISE}@*@r{(0xFFFFFF02)}. All routes carry this value
456must not be advertise to other BGP peers.
457@item local-AS
458@code{local-AS} represents well-known communities value
459@code{NO_EXPORT_SUBCONFED} @r{(0xFFFFFF03)}. All routes carry this
460value must not be advertised to external BGP peers. Even if the
461neighboring router is part of confederation, it is considered as
462external BGP peer, so the route will not be announced to the peer.
463@end table
464
465 When BGP communities attribute is received, duplicated communities
466value in the communities attribute is ignored and each communities
467values are sorted in numerical order.
468
469@menu
470* BGP Community Lists::
471* Numbered BGP Community Lists::
472* BGP Community in Route Map::
473* Display BGP Routes by Community::
474* Using BGP Communities Attribute::
475@end menu
476
paul76b89b42004-11-06 17:13:09 +0000477@node BGP Community Lists
paul718e3742002-12-13 20:15:29 +0000478@subsection BGP Community Lists
479
480 BGP community list is a user defined BGP communites attribute list.
481BGP community list can be used for matching or manipulating BGP
482communities attribute in updates.
483
484 There are two types of community list. One is standard community
485list and another is expanded community list. Standard community list
486defines communities attribute. Expanded community list defines
487communities attribute string with regular expression. Standard
488community list is compiled into binary format when user define it.
489Standard community list will be directly compared to BGP communities
490attribute in BGP updates. Therefore the comparison is faster than
491expanded community list.
492
493@deffn Command {ip community-list standard @var{name} @{permit|deny@} @var{community}} {}
494This command defines a new standard community list. @var{community}
495is communities value. The @var{community} is compiled into community
496structure. We can define multiple community list under same name. In
497that case match will happen user defined order. Once the
498community list matches to communities attribute in BGP updates it
499return permit or deny by the community list definition. When there is
500no matched entry, deny will be returned. When @var{community} is
501empty it matches to any routes.
502@end deffn
503
504@deffn Command {ip community-list expanded @var{name} @{permit|deny@} @var{line}} {}
505This command defines a new expanded community list. @var{line} is a
506string expression of communities attribute. @var{line} can include
507regular expression to match communities attribute in BGP updates.
508@end deffn
509
510@deffn Command {no ip community-list @var{name}} {}
511@deffnx Command {no ip community-list standard @var{name}} {}
512@deffnx Command {no ip community-list expanded @var{name}} {}
513These commands delete community lists specified by @var{name}. All of
514community lists shares a single name space. So community lists can be
515removed simpley specifying community lists name.
516@end deffn
517
518@deffn {Command} {show ip community-list} {}
519@deffnx {Command} {show ip community-list @var{name}} {}
520This command display current community list information. When
521@var{name} is specified the specified community list's information is
522shown.
523
524@example
525# show ip community-list
526Named Community standard list CLIST
527 permit 7675:80 7675:100 no-export
528 deny internet
529Named Community expanded list EXPAND
530 permit :
531
532# show ip community-list CLIST
533Named Community standard list CLIST
534 permit 7675:80 7675:100 no-export
535 deny internet
536@end example
537@end deffn
538
paul76b89b42004-11-06 17:13:09 +0000539@node Numbered BGP Community Lists
paul718e3742002-12-13 20:15:29 +0000540@subsection Numbered BGP Community Lists
541
542 When number is used for BGP community list name, the number has
543special meanings. Community list number in the range from 1 and 99 is
544standard community list. Community list number in the range from 100
545to 199 is expanded community list. These community lists are called
546as numbered community lists. On the other hand normal community lists
547is called as named community lists.
548
549@deffn Command {ip community-list <1-99> @{permit|deny@} @var{community}} {}
550This command defines a new community list. <1-99> is standard
551community list number. Community list name within this range defines
552standard community list. When @var{community} is empty it matches to
553any routes.
554@end deffn
555
556@deffn Command {ip community-list <100-199> @{permit|deny@} @var{community}} {}
557This command defines a new community list. <100-199> is expanded
558community list number. Community list name within this range defines
559expanded community list.
560@end deffn
561
562@deffn Command {ip community-list @var{name} @{permit|deny@} @var{community}} {}
563When community list type is not specifed, the community list type is
564automatically detected. If @var{community} can be compiled into
565communities attribute, the community list is defined as a standard
566community list. Otherwise it is defined as an expanded community
567list. This feature is left for backward compability. Use of this
568feature is not recommended.
569@end deffn
570
paul76b89b42004-11-06 17:13:09 +0000571@node BGP Community in Route Map
paul718e3742002-12-13 20:15:29 +0000572@subsection BGP Community in Route Map
573
574 In Route Map (@pxref{Route Map}), we can match or set BGP
575communities attribute. Using this feature network operator can
576implement their network policy based on BGP communities attribute.
577
578 Following commands can be used in Route Map.
579
580@deffn {Route Map} {match community @var{word}} {}
581@deffnx {Route Map} {match community @var{word} exact-match} {}
582This command perform match to BGP updates using community list
583@var{word}. When the one of BGP communities value match to the one of
584communities value in community list, it is match. When
585@code{exact-match} keyword is spcified, match happen only when BGP
586updates have completely same communities value specified in the
587community list.
588@end deffn
589
590@deffn {Route Map} {set community none} {}
591@deffnx {Route Map} {set community @var{community}} {}
592@deffnx {Route Map} {set community @var{community} additive} {}
593This command manipulate communities value in BGP updates. When
594@code{none} is specified as communities value, it removes entire
595communities attribute from BGP updates. When @var{community} is not
596@code{none}, specified communities value is set to BGP updates. If
597BGP updates already has BGP communities value, the existing BGP
598communities value is replaced with specified @var{community} value.
599When @code{additive} keyword is specified, @var{community} is appended
600to the existing communities value.
601@end deffn
602
603@deffn {Route Map} {set comm-list @var{word} delete} {}
604This command remove communities value from BGP communities attribute.
605The @var{word} is community list name. When BGP route's communities
606value matches to the community list @var{word}, the communities value
607is removed. When all of communities value is removed eventually, the
608BGP update's communities attribute is completely removed.
609@end deffn
610
paul76b89b42004-11-06 17:13:09 +0000611@node Display BGP Routes by Community
paul718e3742002-12-13 20:15:29 +0000612@subsection Display BGP Routes by Community
613
614 To show BGP routes which has specific BGP communities attribute,
615@code{show ip bgp} command can be used. The @var{community} value and
616community list can be used for @code{show ip bgp} command.
617
618@deffn Command {show ip bgp community} {}
619@deffnx Command {show ip bgp community @var{community}} {}
620@deffnx Command {show ip bgp community @var{community} exact-match} {}
621@code{show ip bgp community} displays BGP routes which has communities
622attribute. When @var{community} is specified, BGP routes that matches
623@var{community} value is displayed. For this command, @code{internet}
624keyword can't be used for @var{community} value. When
625@code{exact-match} is specified, it display only routes that have an
626exact match.
627@end deffn
628
629@deffn Command {show ip bgp community-list @var{word}} {}
630@deffnx Command {show ip bgp community-list @var{word} exact-match} {}
631This commands display BGP routes that matches community list
632@var{word}. When @code{exact-match} is specified, display only routes
633that have an exact match.
634@end deffn
635
paul76b89b42004-11-06 17:13:09 +0000636@node Using BGP Communities Attribute
paul718e3742002-12-13 20:15:29 +0000637@subsection Using BGP Communities Attribute
638
639 Following configuration is the most typical usage of BGP communities
640attribute. AS 7675 provides upstream Internet connection to AS 100.
641When following configuration exists in AS 7675, AS 100 networks
642operator can set local preference in AS 7675 network by setting BGP
643communities attribute to the updates.
644
645@example
646router bgp 7675
647 neighbor 192.168.0.1 remote-as 100
648 neighbor 192.168.0.1 route-map RMAP in
649!
650ip community-list 70 permit 7675:70
651ip community-list 70 deny
652ip community-list 80 permit 7675:80
653ip community-list 80 deny
654ip community-list 90 permit 7675:90
655ip community-list 90 deny
656!
657route-map RMAP permit 10
658 match community 70
659 set local-preference 70
660!
661route-map RMAP permit 20
662 match community 80
663 set local-preference 80
664!
665route-map RMAP permit 30
666 match community 90
667 set local-preference 90
668@end example
669
670 Following configuration announce 10.0.0.0/8 from AS 100 to AS 7675.
671The route has communities value 7675:80 so when above configuration
672exists in AS 7675, announced route's local preference will be set to
673value 80.
674
675@example
676router bgp 100
677 network 10.0.0.0/8
678 neighbor 192.168.0.2 remote-as 7675
679 neighbor 192.168.0.2 route-map RMAP out
680!
681ip prefix-list PLIST permit 10.0.0.0/8
682!
683route-map RMAP permit 10
684 match ip address prefix-list PLIST
685 set community 7675:80
686@end example
687
688 Following configuration is an example of BGP route filtering using
689communities attribute. This configuration only permit BGP routes
690which has BGP communities value 0:80 or 0:90. Network operator can
691put special internal communities value at BGP border router, then
692limit the BGP routes announcement into the internal network.
693
694@example
695router bgp 7675
696 neighbor 192.168.0.1 remote-as 100
697 neighbor 192.168.0.1 route-map RMAP in
698!
699ip community-list 1 permit 0:80 0:90
700!
701route-map RMAP permit in
702 match community 1
703@end example
704
705 Following exmaple filter BGP routes which has communities value 1:1.
706When there is no match community-list returns deny. To avoid
707filtering all of routes, we need to define permit any at last.
708
709@example
710router bgp 7675
711 neighbor 192.168.0.1 remote-as 100
712 neighbor 192.168.0.1 route-map RMAP in
713!
714ip community-list standard FILTER deny 1:1
715ip community-list standard FILTER permit
716!
717route-map RMAP permit 10
718 match community FILTER
719@end example
720
721 Communities value keyword @code{internet} has special meanings in
722standard community lists. In below example @code{internet} act as
723match any. It matches all of BGP routes even if the route does not
724have communities attribute at all. So community list @code{INTERNET}
725is same as above example's @code{FILTER}.
726
727@example
728ip community-list standard INTERNET deny 1:1
729ip community-list standard INTERNET permit internet
730@end example
731
732 Following configuration is an example of communities value deletion.
733With this configuration communities value 100:1 and 100:2 is removed
734from BGP updates. For communities value deletion, only @code{permit}
735community-list is used. @code{deny} community-list is ignored.
736
737@example
738router bgp 7675
739 neighbor 192.168.0.1 remote-as 100
740 neighbor 192.168.0.1 route-map RMAP in
741!
742ip community-list standard DEL permit 100:1 100:2
743!
744route-map RMAP permit 10
745 set comm-list DEL delete
746@end example
747
748@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000749@node BGP Extended Communities Attribute
paul718e3742002-12-13 20:15:29 +0000750@section BGP Extended Communities Attribute
751
752 BGP extended communities attribute is introduced with MPLS VPN/BGP
753technology. MPLS VPN/BGP expands capability of network infrastructure
754to provide VPN functionality. At the same time it requires a new
755framework for policy routing. With BGP Extended Communities Attribute
756we can use Route Target or Site of Origin for implementing network
757policy for MPLS VPN/BGP.
758
759 BGP Extended Communities Attribute is similar to BGP Communities
760Attribute. It is an optional transitive attribute. BGP Extended
761Communities Attribute can carry multiple Extended Community value.
762Each Extended Community value is eight octet length.
763
764 BGP Extended Communities Attribute provides an extended range
765compared with BGP Communities Attribute. Adding to that there is a
766type field in each value to provides community space structure.
767
768 There are two format to define Extended Community value. One is AS
769based format the other is IP address based format.
770
771@table @code
772@item AS:VAL
773This is a format to define AS based Extended Community value.
774@code{AS} part is 2 octets Global Administrator subfield in Extended
775Community value. @code{VAL} part is 4 octets Local Administrator
776subfield. @code{7675:100} represents AS 7675 policy value 100.
777@item IP-Address:VAL
778This is a format to define IP address based Extended Community value.
779@code{IP-Address} part is 4 octets Global Administrator subfield.
780@code{VAL} part is 2 octets Local Administrator subfield.
781@code{10.0.0.1:100} represents
782@end table
783
784@menu
785* BGP Extended Community Lists::
786* BGP Extended Communities in Route Map::
787@end menu
788
paul76b89b42004-11-06 17:13:09 +0000789@node BGP Extended Community Lists
paul718e3742002-12-13 20:15:29 +0000790@subsection BGP Extended Community Lists
791
792 Expanded Community Lists is a user defined BGP Expanded Community
793Lists.
794
795@deffn Command {ip extcommunity-list standard @var{name} @{permit|deny@} @var{extcommunity}} {}
796This command defines a new standard extcommunity-list.
797@var{extcommunity} is extended communities value. The
798@var{extcommunity} is compiled into extended community structure. We
799can define multiple extcommunity-list under same name. In that case
800match will happen user defined order. Once the extcommunity-list
801matches to extended communities attribute in BGP updates it return
802permit or deny based upon the extcommunity-list definition. When
803there is no matched entry, deny will be returned. When
804@var{extcommunity} is empty it matches to any routes.
805@end deffn
806
807@deffn Command {ip extcommunity-list expanded @var{name} @{permit|deny@} @var{line}} {}
808This command defines a new expanded extcommunity-list. @var{line} is
809a string expression of extended communities attribute. @var{line} can
810include regular expression to match extended communities attribute in
811BGP updates.
812@end deffn
813
814@deffn Command {no ip extcommunity-list @var{name}} {}
815@deffnx Command {no ip extcommunity-list standard @var{name}} {}
816@deffnx Command {no ip extcommunity-list expanded @var{name}} {}
817These commands delete extended community lists specified by
818@var{name}. All of extended community lists shares a single name
819space. So extended community lists can be removed simpley specifying
820the name.
821@end deffn
822
823@deffn {Command} {show ip extcommunity-list} {}
824@deffnx {Command} {show ip extcommunity-list @var{name}} {}
825This command display current extcommunity-list information. When
826@var{name} is specified the community list's information is shown.
827
828@example
829# show ip extcommunity-list
830@end example
831@end deffn
832
paul76b89b42004-11-06 17:13:09 +0000833@node BGP Extended Communities in Route Map
paul718e3742002-12-13 20:15:29 +0000834@subsection BGP Extended Communities in Route Map
835
836@deffn {Route Map} {match extcommunity @var{word}} {}
837@end deffn
838
839@deffn {Route Map} {set extcommunity rt @var{extcommunity}} {}
840This command set Route Target value.
841@end deffn
842
843@deffn {Route Map} {set extcommunity soo @var{extcommunity}} {}
844This command set Site of Origin value.
845@end deffn
846
847@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000848@node Displaying BGP routes
paul718e3742002-12-13 20:15:29 +0000849@section Displaying BGP Routes
850
851@menu
852* Show IP BGP::
853* More Show IP BGP::
854@end menu
855
paul76b89b42004-11-06 17:13:09 +0000856@node Show IP BGP
paul718e3742002-12-13 20:15:29 +0000857@subsection Show IP BGP
858
859@deffn {Command} {show ip bgp} {}
860@deffnx {Command} {show ip bgp @var{A.B.C.D}} {}
861@deffnx {Command} {show ip bgp @var{X:X::X:X}} {}
862This command displays BGP routes. When no route is specified it
863display all of IPv4 BGP routes.
864@end deffn
865
866@example
867BGP table version is 0, local router ID is 10.1.1.1
868Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
869Origin codes: i - IGP, e - EGP, ? - incomplete
870
871 Network Next Hop Metric LocPrf Weight Path
872*> 1.1.1.1/32 0.0.0.0 0 32768 i
873
874Total number of prefixes 1
875@end example
876
paul76b89b42004-11-06 17:13:09 +0000877@node More Show IP BGP
paul718e3742002-12-13 20:15:29 +0000878@subsection More Show IP BGP
879
880@deffn {Command} {show ip bgp regexp @var{line}} {}
881This command display BGP routes using AS path regular expression (@pxref{Display BGP Routes by AS Path}).
882@end deffn
883
884@deffn Command {show ip bgp community @var{community}} {}
885@deffnx Command {show ip bgp community @var{community} exact-match} {}
886This command display BGP routes using @var{community} (@pxref{Display
887BGP Routes by Community}).
888@end deffn
889
890@deffn Command {show ip bgp community-list @var{word}} {}
891@deffnx Command {show ip bgp community-list @var{word} exact-match} {}
892This command display BGP routes using community list (@pxref{Display
893BGP Routes by Community}).
894@end deffn
895
896@deffn {Command} {show ip bgp summary} {}
897@end deffn
898
899@deffn {Command} {show ip bgp neighbor [@var{peer}]} {}
900@end deffn
901
902@deffn {Command} {clear ip bgp @var{peer}} {}
903Clear peers which have addresses of X.X.X.X
904@end deffn
905
906@deffn {Command} {clear ip bgp @var{peer} soft in} {}
907Clear peer using soft reconfiguration.
908@end deffn
909
910@deffn {Command} {show debug} {}
911@end deffn
912
913@deffn {Command} {debug event} {}
914@end deffn
915
916@deffn {Command} {debug update} {}
917@end deffn
918
919@deffn {Command} {debug keepalive} {}
920@end deffn
921
922@deffn {Command} {no debug event} {}
923@end deffn
924
925@deffn {Command} {no debug update} {}
926@end deffn
927
928@deffn {Command} {no debug keepalive} {}
929@end deffn
930
paul76b89b42004-11-06 17:13:09 +0000931@node Capability Negotiation
paul718e3742002-12-13 20:15:29 +0000932@section Capability Negotiation
933
934 When adding IPv6 routing information exchange feature to BGP. There
935were some proposals. @acronym{IETF} @acronym{IDR} working group finally
936take a proposal called Multiprotocol Extension for BGP. The
937specification is described in RFC2283. The protocol does not define new
938protocols. It defines new attributes to existing BGP. When it is used
939exchanging IPv6 routing information it is called BGP-4+. When it is
940used for exchanging multicast routing information it is called MBGP.
941
942 @command{bgpd} supports Multiprotocol Extension for BGP. So if remote peer
943supports the protocol, @command{bgpd} can exchange IPv6 and/or multicast routing
944information.
945
946 Traditional BGP does not have the feature to detect remote peer's
947capability whether it can handle other than IPv4 unicast routes. This
948is a big problem using Multiprotocol Extension for BGP to operational
949network. @cite{draft-ietf-idr-bgp4-cap-neg-04.txt} is proposing a
950feature called Capability Negotiation. @command{bgpd} use this Capability
951Negotiation to detect remote peer's capabilities. If the peer is only
952configured as IPv4 unicast neighbor, @command{bgpd} does not send these Capability
953Negotiation packets.
954
paul7190f4e2003-08-12 12:40:20 +0000955 By default, Quagga will bring up peering with minimal common capability
paul718e3742002-12-13 20:15:29 +0000956for the both sides. For example, local router has unicast and multicast
957capabilitie and remote router has unicast capability. In this case,
958the local router will establish the connection with unicast only capability.
paul7190f4e2003-08-12 12:40:20 +0000959When there are no common capabilities, Quagga sends Unsupported Capability
paul718e3742002-12-13 20:15:29 +0000960error and then resets the connection.
961
962 If you want to completely match capabilities with remote peer. Please
963use @command{strict-capability-match} command.
964
965@deffn {BGP} {neighbor @var{peer} strict-capability-match} {}
966@deffnx {BGP} {no neighbor @var{peer} strict-capability-match} {}
967Strictly compares remote capabilities and local capabilities. If capabilities
968are different, send Unsupported Capability error then reset connection.
969@end deffn
970
971 You may want to disable sending Capability Negotiation OPEN message
972optional parameter to the peer when remote peer does not implement
973Capability Negotiation. Please use @command{dont-capability-negotiate}
974command to disable the feature.
975
976@deffn {BGP} {neighbor @var{peer} dont-capability-negotiate} {}
977@deffnx {BGP} {no neighbor @var{peer} dont-capability-negotiate} {}
978Suppress sending Capability Negotiation as OPEN message optional
979parameter to the peer. This command only affects the peer is configured
980other than IPv4 unicast configuration.
981@end deffn
982
983 When remote peer does not have capability negotiation feature, remote
984peer will not send any capabilities at all. In that case, bgp configures
985the peer with configured capabilities.
986
987 You may prefer locally configured capabilities more than the negotiated
988capabilities even though remote peer sends capabilities. If the peer is
989configured by @command{override-capability}, @command{bgpd} ignores received
990capabilities then override negotiated capabilities with configured values.
991
992@deffn {BGP} {neighbor @var{peer} override-capability} {}
993@deffnx {BGP} {no neighbor @var{peer} override-capability} {}
994Override the result of Capability Negotiation with local configuration.
995Ignore remote peer's capability value.
996@end deffn
997
paul76b89b42004-11-06 17:13:09 +0000998@node Route Reflector
paul718e3742002-12-13 20:15:29 +0000999@section Route Reflector
1000
1001@deffn {BGP} {bgp cluster-id @var{a.b.c.d}} {}
1002@end deffn
1003
1004@deffn {BGP} {neighbor @var{peer} route-reflector-client} {}
1005@deffnx {BGP} {no neighbor @var{peer} route-reflector-client} {}
1006@end deffn
1007
paul76b89b42004-11-06 17:13:09 +00001008@node Route Server
paul718e3742002-12-13 20:15:29 +00001009@section Route Server
1010
1011At an Internet Exchange point, many ISPs are connected to each other by
1012external BGP peering. Normally these external BGP connection are done by
1013@code{full mesh} method. As with internal BGP full mesh formation,
1014this method has a scaling problem.
1015
1016This scaling problem is well known. Route Server is a method to resolve
1017the problem. Each ISP's BGP router only peers to Route Server. Route
1018Server serves as BGP information exchange to other BGP routers. By
1019applying this method, numbers of BGP connections is reduced from
1020O(n*(n-1)/2) to O(n).
1021
1022Unlike normal BGP router, Route Server must have several routing tables
1023for managing different routing policies for each BGP speaker. We call the
1024routing tables as different @code{view}s. @command{bgpd} can work as
1025normal BGP router or Route Server or both at the same time.
1026
1027@menu
1028* Multiple instance::
1029* BGP instance and view::
1030* Routing policy::
1031* Viewing the view::
1032@end menu
1033
paul76b89b42004-11-06 17:13:09 +00001034@node Multiple instance
paul718e3742002-12-13 20:15:29 +00001035@subsection Multiple instance
1036
1037To enable multiple view function of @code{bgpd}, you must turn on
1038multiple instance feature beforehand.
1039
1040@deffn {Command} {bgp multiple-instance} {}
1041Enable BGP multiple instance feature. After this feature is enabled,
1042you can make multiple BGP instances or multiple BGP views.
1043@end deffn
1044
1045@deffn {Command} {no bgp multiple-instance} {}
1046Disable BGP multiple instance feature. You can not disable this feature
1047when BGP multiple instances or views exist.
1048@end deffn
1049
1050When you want to make configuration more Cisco like one,
1051
1052@deffn {Command} {bgp config-type cisco} {}
1053Cisco compatible BGP configuration output.
1054@end deffn
1055
1056When bgp config-type cisco is specified,
1057
1058``no synchronization'' is displayed.
1059``no auto-summary'' is desplayed.
1060
1061``network'' and ``aggregate-address'' argument is displayed as
1062``A.B.C.D M.M.M.M''
1063
paul7190f4e2003-08-12 12:40:20 +00001064Quagga: network 10.0.0.0/8
paul718e3742002-12-13 20:15:29 +00001065Cisco: network 10.0.0.0
1066
paul7190f4e2003-08-12 12:40:20 +00001067Quagga: aggregate-address 192.168.0.0/24
paul718e3742002-12-13 20:15:29 +00001068Cisco: aggregate-address 192.168.0.0 255.255.255.0
1069
1070Community attribute handling is also different. If there is no
1071configuration is specified community attribute and extended community
1072attribute are sent to neighbor. When user manually disable the
1073feature community attribute is not sent to the neighbor. In case of
1074``bgp config-type cisco'' is specified, community attribute is not
1075sent to the neighbor by default. To send community attribute user has
1076to specify ``neighbor A.B.C.D send-community'' command.
1077
1078!
1079router bgp 1
1080 neighbor 10.0.0.1 remote-as 1
1081 no neighbor 10.0.0.1 send-community
1082!
1083
1084!
1085router bgp 1
1086 neighbor 10.0.0.1 remote-as 1
1087 neighbor 10.0.0.1 send-community
1088!
1089
1090@deffn {Command} {bgp config-type zebra} {}
paul7190f4e2003-08-12 12:40:20 +00001091Quagga style BGP configuration. This is default.
paul718e3742002-12-13 20:15:29 +00001092@end deffn
1093
paul76b89b42004-11-06 17:13:09 +00001094@node BGP instance and view
paul718e3742002-12-13 20:15:29 +00001095@subsection BGP instance and view
1096
1097BGP instance is a normal BGP process. The result of route selection
1098goes to the kernel routing table. You can setup different AS at the
1099same time when BGP multiple instance feature is enabled.
1100
1101@deffn {Command} {router bgp @var{as-number}} {}
1102Make a new BGP instance. You can use arbitrary word for the @var{name}.
1103@end deffn
1104
1105@example
1106@group
1107bgp multiple-instance
1108!
1109router bgp 1
1110 neighbor 10.0.0.1 remote-as 2
1111 neighbor 10.0.0.2 remote-as 3
1112!
1113router bgp 2
1114 neighbor 10.0.0.3 remote-as 4
1115 neighbor 10.0.0.4 remote-as 5
1116@end group
1117@end example
1118
1119BGP view is almost same as normal BGP process. The result of
1120route selection does not go to the kernel routing table. BGP view is
1121only for exchanging BGP routing information.
1122
1123@deffn {Command} {router bgp @var{as-number} view @var{name}} {}
1124Make a new BGP view. You can use arbitrary word for the @var{name}. This
1125view's route selection result does not go to the kernel routing table.
1126@end deffn
1127
1128With this command, you can setup Route Server like below.
1129
1130@example
1131@group
1132bgp multiple-instance
1133!
1134router bgp 1 view 1
1135 neighbor 10.0.0.1 remote-as 2
1136 neighbor 10.0.0.2 remote-as 3
1137!
1138router bgp 2 view 2
1139 neighbor 10.0.0.3 remote-as 4
1140 neighbor 10.0.0.4 remote-as 5
1141@end group
1142@end example
1143
paul76b89b42004-11-06 17:13:09 +00001144@node Routing policy
paul718e3742002-12-13 20:15:29 +00001145@subsection Routing policy
1146
1147You can set different routing policy for a peer. For example, you can
1148set different filter for a peer.
1149
1150@example
1151@group
1152bgp multiple-instance
1153!
1154router bgp 1 view 1
1155 neighbor 10.0.0.1 remote-as 2
1156 neighbor 10.0.0.1 distribute-list 1 in
1157!
1158router bgp 1 view 2
1159 neighbor 10.0.0.1 remote-as 2
1160 neighbor 10.0.0.1 distribute-list 2 in
1161@end group
1162@end example
1163
1164This means BGP update from a peer 10.0.0.1 goes to both BGP view 1 and view
11652. When the update is inserted into view 1, distribute-list 1 is
1166applied. On the other hand, when the update is inserted into view 2,
1167distribute-list 2 is applied.
1168
paul76b89b42004-11-06 17:13:09 +00001169@node Viewing the view
paul718e3742002-12-13 20:15:29 +00001170@subsection Viewing the view
1171
1172To display routing table of BGP view, you must specify view name.
1173
1174@deffn {Command} {show ip bgp view @var{name}} {}
1175Display routing table of BGP view @var{name}.
1176@end deffn
1177
paul76b89b42004-11-06 17:13:09 +00001178@node How to set up a 6-Bone connection
paul718e3742002-12-13 20:15:29 +00001179@section How to set up a 6-Bone connection
1180
paul6a22b1f2004-11-07 19:39:13 +00001181
paul718e3742002-12-13 20:15:29 +00001182@example
1183@group
1184zebra configuration
1185===================
1186!
1187! Actually there is no need to configure zebra
1188!
1189
1190bgpd configuration
1191==================
1192!
1193! This means that routes go through zebra and into the kernel.
1194!
1195router zebra
1196!
1197! MP-BGP configuration
1198!
1199router bgp 7675
1200 bgp router-id 10.0.0.1
1201 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 remote-as @var{as-number}
1202!
1203 address-family ipv6
1204 network 3ffe:506::/32
1205 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 activate
1206 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 route-map set-nexthop out
1207 neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 remote-as @var{as-number}
1208 neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 route-map set-nexthop out
1209 exit-address-family
1210!
1211ipv6 access-list all permit any
1212!
1213! Set output nexthop address.
1214!
1215route-map set-nexthop permit 10
1216 match ipv6 address all
1217 set ipv6 nexthop global 3ffe:1cfa:0:2:2c0:4fff:fe68:a225
1218 set ipv6 nexthop local fe80::2c0:4fff:fe68:a225
1219!
1220! logfile FILENAME is obsolete. Please use log file FILENAME
paul7190f4e2003-08-12 12:40:20 +00001221
paul718e3742002-12-13 20:15:29 +00001222log file bgpd.log
1223!
1224@end group
1225@end example
1226
paul76b89b42004-11-06 17:13:09 +00001227@node Dump BGP packets and table
paul718e3742002-12-13 20:15:29 +00001228@section Dump BGP packets and table
1229
1230@deffn Command {dump bgp all @var{path}} {}
1231@deffnx Command {dump bgp all @var{path} @var{interval}} {}
1232Dump all BGP packet and events to @var{path} file.
1233@end deffn
1234
1235@deffn Command {dump bgp updates @var{path}} {}
1236@deffnx Command {dump bgp updates @var{path} @var{interval}} {}
1237Dump BGP updates to @var{path} file.
1238@end deffn
1239
1240@deffn Command {dump bgp routes @var{path}} {}
1241@deffnx Command {dump bgp routes @var{path}} {}
1242Dump whole BGP routing table to @var{path}. This is heavy process.
1243@end deffn