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