blob: bdfd6e4ccb4383b4a3e7df7f70684d9658099d58 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001@c -*-texinfo-*-
paul7190f4e2003-08-12 12:40:20 +00002@c This is part of the Quagga Manual.
paul76b89b42004-11-06 17:13:09 +00003@c @value{COPYRIGHT_STR}
4@c See file quagga.texi for copying conditions.
paul718e3742002-12-13 20:15:29 +00005@node BGP
paul718e3742002-12-13 20:15:29 +00006@chapter BGP
7
paulaa5943f2005-11-04 21:53:59 +00008@acronym{BGP} stands for a Border Gateway Protocol. The lastest BGP version
paul718e3742002-12-13 20:15:29 +00009is 4. It is referred as BGP-4. BGP-4 is one of the Exterior Gateway
10Protocols and de-fact standard of Inter Domain routing protocol.
paulaa5943f2005-11-04 21:53:59 +000011BGP-4 is described in @cite{RFC1771, A Border Gateway Protocol
paul718e3742002-12-13 20:15:29 +0000124 (BGP-4)}.
13
paulaa5943f2005-11-04 21:53:59 +000014Many extensions have been added to @cite{RFC1771}. @cite{RFC2858,
15Multiprotocol Extensions for BGP-4} provides multiprotocol support to
16BGP-4.
paul718e3742002-12-13 20:15:29 +000017
18@menu
19* Starting BGP::
20* BGP router::
21* BGP network::
22* BGP Peer::
23* BGP Peer Group::
24* BGP Address Family::
25* Autonomous System::
26* BGP Communities Attribute::
27* BGP Extended Communities Attribute::
28* Displaying BGP routes::
29* Capability Negotiation::
30* Route Reflector::
31* Route Server::
32* How to set up a 6-Bone connection::
33* Dump BGP packets and table::
paulaa5943f2005-11-04 21:53:59 +000034* BGP Configuration Examples::
paul718e3742002-12-13 20:15:29 +000035@end menu
36
paul76b89b42004-11-06 17:13:09 +000037@node Starting BGP
paul718e3742002-12-13 20:15:29 +000038@section Starting BGP
39
40Default configuration file of @command{bgpd} is @file{bgpd.conf}.
41@command{bgpd} searches the current directory first then
42@value{INSTALL_PREFIX_ETC}/bgpd.conf. All of bgpd's command must be
43configured in @file{bgpd.conf}.
44
45@command{bgpd} specific invocation options are described below. Common
46options may also be specified (@pxref{Common Invocation Options}).
47
48@table @samp
49@item -p @var{PORT}
50@itemx --bgp_port=@var{PORT}
51Set the bgp protocol's port number.
52
53@item -r
54@itemx --retain
55When program terminates, retain BGP routes added by zebra.
56@end table
57
paul76b89b42004-11-06 17:13:09 +000058@node BGP router
paul718e3742002-12-13 20:15:29 +000059@section BGP router
60
61 First of all you must configure BGP router with @command{router bgp}
62command. To configure BGP router, you need AS number. AS number is an
63identification of autonomous system. BGP protocol uses the AS number
64for detecting whether the BGP connection is internal one or external one.
65
66@deffn Command {router bgp @var{asn}} {}
67Enable a BGP protocol process with the specified @var{asn}. After
68this statement you can input any @code{BGP Commands}. You can not
69create different BGP process under different @var{asn} without
70specifying @code{multiple-instance} (@pxref{Multiple instance}).
71@end deffn
72
73@deffn Command {no router bgp @var{asn}} {}
74Destroy a BGP protocol process with the specified @var{asn}.
75@end deffn
76
77@deffn {BGP} {bgp router-id @var{A.B.C.D}} {}
78This command specifies the router-ID. If @command{bgpd} connects to @command{zebra} it gets
79interface and address information. In that case default router ID value
80is selected as the largest IP Address of the interfaces. When
81@code{router zebra} is not enabled @command{bgpd} can't get interface information
82so @code{router-id} is set to 0.0.0.0. So please set router-id by hand.
83@end deffn
84
85@menu
86* BGP distance::
87* BGP decision process::
88@end menu
89
paul76b89b42004-11-06 17:13:09 +000090@node BGP distance
paul718e3742002-12-13 20:15:29 +000091@subsection BGP distance
92
93@deffn {BGP} {distance bgp <1-255> <1-255> <1-255>} {}
94This command change distance value of BGP. Each argument is distance
95value for external routes, internal routes and local routes.
96@end deffn
97
98@deffn {BGP} {distance <1-255> @var{A.B.C.D/M}} {}
99@deffnx {BGP} {distance <1-255> @var{A.B.C.D/M} @var{word}} {}
100This command set distance value to
101@end deffn
102
paul76b89b42004-11-06 17:13:09 +0000103@node BGP decision process
paul718e3742002-12-13 20:15:29 +0000104@subsection BGP decision process
105
106@table @asis
107@item 1. Weight check
108
109@item 2. Local preference check.
110
111@item 3. Local route check.
112
113@item 4. AS path length check.
114
115@item 5. Origin check.
116
117@item 6. MED check.
118@end table
119
hasso68118452005-04-08 15:40:36 +0000120@deffn {BGP} {bgp bestpath as-path confed} {}
121This command specifies that the length of confederation path sets and
122sequences should should be taken into account during the BGP best path
123decision process.
124@end deffn
125
paul76b89b42004-11-06 17:13:09 +0000126@node BGP network
paul718e3742002-12-13 20:15:29 +0000127@section BGP network
128
129@menu
130* BGP route::
131* Route Aggregation::
132* Redistribute to BGP::
133@end menu
134
paul76b89b42004-11-06 17:13:09 +0000135@node BGP route
paul718e3742002-12-13 20:15:29 +0000136@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
Paul Jakma41367172007-08-06 15:24:51 +0000148routes if they aren't present in their IGP routing tables; @code{bgpd}
paul718e3742002-12-13 20:15:29 +0000149doesn't care about IGP routes when announcing its routes.
150@end deffn
151
Paul Jakma41367172007-08-06 15:24:51 +0000152@deffn {BGP} {network @var{A.B.C.D/M} pathlimit <0-255>} {}
153This command configures a route to be originated into BGP, just as with the
154previous command, but additionally sets an AS-Pathlimit TTL to be advertised
155on the route. See draft-ietf-idr-as-pathlimit.
156
157Specifying a TTL of 0 can be used to remove pathlimit from a previously
158configured network statement.
159
160Note that when advertising prefixes with AS-Pathlimit set, all less-specific
161prefixes advertised SHOULD also have the Atomic-Aggregate attribute set.
162Failure to do so increases the risks of accidental routing loops occuring.
163
164This implementation will try to automatically set Atomic-Aggregate as
165appropriate on any less-specific prefixes originated by the same speaker,
166however it will not (and often can not) do so where @b{other} speakers in
167the AS are originating more specifics.
168
169Hence the system administrator must take care to ensure that all
170less-specific prefixes originated carry atomic-aggregate as appropriate, by
171manually configuring speakers originating less-specifics to set
172Atomic-Aggregate on those advertisements!
173@end deffn
174
paul718e3742002-12-13 20:15:29 +0000175@deffn {BGP} {no network @var{A.B.C.D/M}} {}
176@end deffn
177
paul76b89b42004-11-06 17:13:09 +0000178@node Route Aggregation
paul718e3742002-12-13 20:15:29 +0000179@subsection Route Aggregation
180
181@deffn {BGP} {aggregate-address @var{A.B.C.D/M}} {}
182This command specifies an aggregate address.
183@end deffn
184
185@deffn {BGP} {aggregate-address @var{A.B.C.D/M} as-set} {}
186This command specifies an aggregate address. Resulting routes inlucde
187AS set.
188@end deffn
189
190@deffn {BGP} {aggregate-address @var{A.B.C.D/M} summary-only} {}
191This command specifies an aggregate address. Aggreated routes will
192not be announce.
193@end deffn
194
195@deffn {BGP} {no aggregate-address @var{A.B.C.D/M}} {}
196@end deffn
197
paul76b89b42004-11-06 17:13:09 +0000198@node Redistribute to BGP
paul718e3742002-12-13 20:15:29 +0000199@subsection Redistribute to BGP
200
201@deffn {BGP} {redistribute kernel} {}
202Redistribute kernel route to BGP process.
203@end deffn
204
205@deffn {BGP} {redistribute static} {}
206Redistribute static route to BGP process.
207@end deffn
208
209@deffn {BGP} {redistribute connected} {}
210Redistribute connected route to BGP process.
211@end deffn
212
213@deffn {BGP} {redistribute rip} {}
214Redistribute RIP route to BGP process.
215@end deffn
216
217@deffn {BGP} {redistribute ospf} {}
218Redistribute OSPF route to BGP process.
219@end deffn
220
paul76b89b42004-11-06 17:13:09 +0000221@node BGP Peer
paul718e3742002-12-13 20:15:29 +0000222@section BGP Peer
223
224@menu
225* Defining Peer::
226* BGP Peer commands::
227* Peer filtering::
228@end menu
229
paul76b89b42004-11-06 17:13:09 +0000230@node Defining Peer
paul718e3742002-12-13 20:15:29 +0000231@subsection Defining Peer
232
233@deffn {BGP} {neighbor @var{peer} remote-as @var{asn}} {}
234Creates a new neighbor whose remote-as is @var{asn}. @var{peer}
235can be an IPv4 address or an IPv6 address.
236@example
237@group
238router bgp 1
239 neighbor 10.0.0.1 remote-as 2
240@end group
241@end example
242In this case my router, in AS-1, is trying to peer with AS-2 at
24310.0.0.1.
244
245This command must be the first command used when configuring a neighbor.
246If the remote-as is not specified, @command{bgpd} will complain like this:
247@example
248can't find neighbor 10.0.0.1
249@end example
250@end deffn
251
paul76b89b42004-11-06 17:13:09 +0000252@node BGP Peer commands
paul718e3742002-12-13 20:15:29 +0000253@subsection BGP Peer commands
254
255In a @code{router bgp} clause there are neighbor specific configurations
256required.
257
258@deffn {BGP} {neighbor @var{peer} shutdown} {}
259@deffnx {BGP} {no neighbor @var{peer} shutdown} {}
260Shutdown the peer. We can delete the neighbor's configuration by
261@code{no neighbor @var{peer} remote-as @var{as-number}} but all
262configuration of the neighbor will be deleted. When you want to
263preserve the configuration, but want to drop the BGP peer, use this
264syntax.
265@end deffn
266
267@deffn {BGP} {neighbor @var{peer} ebgp-multihop} {}
268@deffnx {BGP} {no neighbor @var{peer} ebgp-multihop} {}
269@end deffn
270
271@deffn {BGP} {neighbor @var{peer} description ...} {}
272@deffnx {BGP} {no neighbor @var{peer} description ...} {}
273Set description of the peer.
274@end deffn
275
276@deffn {BGP} {neighbor @var{peer} version @var{version}} {}
277Set up the neighbor's BGP version. @var{version} can be @var{4},
278@var{4+} or @var{4-}. BGP version @var{4} is the default value used for
279BGP peering. BGP version @var{4+} means that the neighbor supports
280Multiprotocol Extensions for BGP-4. BGP version @var{4-} is similar but
281the neighbor speaks the old Internet-Draft revision 00's Multiprotocol
282Extensions for BGP-4. Some routing software is still using this
283version.
284@end deffn
285
286@deffn {BGP} {neighbor @var{peer} interface @var{ifname}} {}
287@deffnx {BGP} {no neighbor @var{peer} interface @var{ifname}} {}
Paul Jakma825cd492006-05-23 22:20:34 +0000288When you connect to a BGP peer over an IPv6 link-local address, you
289have to specify the @var{ifname} of the interface used for the
290connection. To specify IPv4 session addresses, see the
291@code{neighbor @var{peer} update-source} command below.
292
293This command is deprecated and may be removed in a future release. Its
294use should be avoided.
paul718e3742002-12-13 20:15:29 +0000295@end deffn
296
297@deffn {BGP} {neighbor @var{peer} next-hop-self} {}
298@deffnx {BGP} {no neighbor @var{peer} next-hop-self} {}
299This command specifies an announced route's nexthop as being equivalent
300to the address of the bgp router.
301@end deffn
302
Paul Jakma466c9652006-06-26 12:55:58 +0000303@deffn {BGP} {neighbor @var{peer} update-source @var{<ifname|address>}} {}
paul718e3742002-12-13 20:15:29 +0000304@deffnx {BGP} {no neighbor @var{peer} update-source} {}
Paul Jakma825cd492006-05-23 22:20:34 +0000305Specify the IPv4 source address to use for the @acronym{BGP} session to this
306neighbour, may be specified as either an IPv4 address directly or
307as an interface name (in which case the @command{zebra} daemon MUST be running
308in order for @command{bgpd} to be able to retrieve interface state).
309@example
310@group
311router bgp 64555
312 neighbor foo update-source 192.168.0.1
313 neighbor bar update-source lo0
314@end group
315@end example
paul718e3742002-12-13 20:15:29 +0000316@end deffn
317
318@deffn {BGP} {neighbor @var{peer} default-originate} {}
319@deffnx {BGP} {no neighbor @var{peer} default-originate} {}
320@command{bgpd}'s default is to not announce the default route (0.0.0.0/0) even it
321is in routing table. When you want to announce default routes to the
322peer, use this command.
323@end deffn
324
325@deffn {BGP} {neighbor @var{peer} port @var{port}} {}
326@deffnx {BGP} {neighbor @var{peer} port @var{port}} {}
327@end deffn
328
329@deffn {BGP} {neighbor @var{peer} send-community} {}
330@deffnx {BGP} {neighbor @var{peer} send-community} {}
331@end deffn
332
333@deffn {BGP} {neighbor @var{peer} weight @var{weight}} {}
334@deffnx {BGP} {no neighbor @var{peer} weight @var{weight}} {}
335This command specifies a default @var{weight} value for the neighbor's
336routes.
337@end deffn
338
339@deffn {BGP} {neighbor @var{peer} maximum-prefix @var{number}} {}
340@deffnx {BGP} {no neighbor @var{peer} maximum-prefix @var{number}} {}
341@end deffn
342
paul76b89b42004-11-06 17:13:09 +0000343@node Peer filtering
paul718e3742002-12-13 20:15:29 +0000344@subsection Peer filtering
345
346@deffn {BGP} {neighbor @var{peer} distribute-list @var{name} [in|out]} {}
347This command specifies a distribute-list for the peer. @var{direct} is
348@samp{in} or @samp{out}.
349@end deffn
350
351@deffn {BGP command} {neighbor @var{peer} prefix-list @var{name} [in|out]} {}
352@end deffn
353
354@deffn {BGP command} {neighbor @var{peer} filter-list @var{name} [in|out]} {}
355@end deffn
356
357@deffn {BGP} {neighbor @var{peer} route-map @var{name} [in|out]} {}
358Apply a route-map on the neighbor. @var{direct} must be @code{in} or
359@code{out}.
360@end deffn
361
362@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000363@node BGP Peer Group
paul718e3742002-12-13 20:15:29 +0000364@section BGP Peer Group
365
366@deffn {BGP} {neighbor @var{word} peer-group} {}
367This command defines a new peer group.
368@end deffn
369
370@deffn {BGP} {neighbor @var{peer} peer-group @var{word}} {}
371This command bind specific peer to peer group @var{word}.
372@end deffn
373
paul76b89b42004-11-06 17:13:09 +0000374@node BGP Address Family
paul718e3742002-12-13 20:15:29 +0000375@section BGP Address Family
376
paul718e3742002-12-13 20:15:29 +0000377@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000378@node Autonomous System
paul718e3742002-12-13 20:15:29 +0000379@section Autonomous System
380
paulaa5943f2005-11-04 21:53:59 +0000381The @acronym{AS,Autonomous System} number is one of the essential
382element of BGP. BGP is a distance vector routing protocol, and the
383AS-Path framework provides distance vector metric and loop detection to
384BGP. @cite{RFC1930, Guidelines for creation, selection, and
385registration of an Autonomous System (AS)} provides some background on
386the concepts of an AS.
paul718e3742002-12-13 20:15:29 +0000387
paulaa5943f2005-11-04 21:53:59 +0000388The AS number is a two octet value, ranging in value from 1 to 65535.
389The AS numbers 64512 through 65535 are defined as private AS numbers.
390Private AS numbers must not to be advertised in the global Internet.
paul718e3742002-12-13 20:15:29 +0000391
392@menu
393* AS Path Regular Expression::
394* Display BGP Routes by AS Path::
395* AS Path Access List::
396* Using AS Path in Route Map::
397* Private AS Numbers::
398@end menu
399
paul76b89b42004-11-06 17:13:09 +0000400@node AS Path Regular Expression
paul718e3742002-12-13 20:15:29 +0000401@subsection AS Path Regular Expression
402
paulaa5943f2005-11-04 21:53:59 +0000403AS path regular expression can be used for displaying BGP routes and
paul718e3742002-12-13 20:15:29 +0000404AS path access list. AS path regular expression is based on
405@code{POSIX 1003.2} regular expressions. Following description is
406just a subset of @code{POSIX} regular expression. User can use full
407@code{POSIX} regular expression. Adding to that special character '_'
408is added for AS path regular expression.
409
410@table @code
411@item .
412Matches any single character.
413@item *
414Matches 0 or more occurrences of pattern.
415@item +
416Matches 1 or more occurrences of pattern.
417@item ?
418Match 0 or 1 occurrences of pattern.
419@item ^
420Matches the beginning of the line.
421@item $
422Matches the end of the line.
423@item _
424Character @code{_} has special meanings in AS path regular expression.
425It matches to space and comma , and AS set delimiter @{ and @} and AS
426confederation delimiter @code{(} and @code{)}. And it also matches to
427the beginning of the line and the end of the line. So @code{_} can be
428used for AS value boundaries match. @code{show ip bgp regexp _7675_}
429matches to all of BGP routes which as AS number include @var{7675}.
430@end table
431
paul76b89b42004-11-06 17:13:09 +0000432@node Display BGP Routes by AS Path
paul718e3742002-12-13 20:15:29 +0000433@subsection Display BGP Routes by AS Path
434
paulaa5943f2005-11-04 21:53:59 +0000435To show BGP routes which has specific AS path information @code{show
paul718e3742002-12-13 20:15:29 +0000436ip bgp} command can be used.
437
438@deffn Command {show ip bgp regexp @var{line}} {}
439This commands display BGP routes that matches AS path regular
440expression @var{line}.
441@end deffn
442
paul76b89b42004-11-06 17:13:09 +0000443@node AS Path Access List
paul718e3742002-12-13 20:15:29 +0000444@subsection AS Path Access List
445
paulaa5943f2005-11-04 21:53:59 +0000446AS path access list is user defined AS path.
paul718e3742002-12-13 20:15:29 +0000447
448@deffn {Command} {ip as-path access-list @var{word} @{permit|deny@} @var{line}} {}
449This command defines a new AS path access list.
450@end deffn
451
452@deffn {Command} {no ip as-path access-list @var{word}} {}
453@deffnx {Command} {no ip as-path access-list @var{word} @{permit|deny@} @var{line}} {}
454@end deffn
455
paul76b89b42004-11-06 17:13:09 +0000456@node Using AS Path in Route Map
paul718e3742002-12-13 20:15:29 +0000457@subsection Using AS Path in Route Map
458
459@deffn {Route Map} {match as-path @var{word}} {}
460@end deffn
461
462@deffn {Route Map} {set as-path prepend @var{as-path}} {}
463@end deffn
464
paul76b89b42004-11-06 17:13:09 +0000465@node Private AS Numbers
paul718e3742002-12-13 20:15:29 +0000466@subsection Private AS Numbers
467
paul718e3742002-12-13 20:15:29 +0000468@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000469@node BGP Communities Attribute
paul718e3742002-12-13 20:15:29 +0000470@section BGP Communities Attribute
471
paulaa5943f2005-11-04 21:53:59 +0000472BGP communities attribute is widely used for implementing policy
paul718e3742002-12-13 20:15:29 +0000473routing. Network operators can manipulate BGP communities attribute
474based on their network policy. BGP communities attribute is defined
paulaa5943f2005-11-04 21:53:59 +0000475in @cite{RFC1997, BGP Communities Attribute} and
476@cite{RFC1998, An Application of the BGP Community Attribute
paul718e3742002-12-13 20:15:29 +0000477in Multi-home Routing}. It is an optional transitive attribute,
478therefore local policy can travel through different autonomous system.
479
paulaa5943f2005-11-04 21:53:59 +0000480Communities attribute is a set of communities values. Each
paul718e3742002-12-13 20:15:29 +0000481communities value is 4 octet long. The following format is used to
482define communities value.
483
484@table @code
485@item AS:VAL
486This format represents 4 octet communities value. @code{AS} is high
487order 2 octet in digit format. @code{VAL} is low order 2 octet in
488digit format. This format is useful to define AS oriented policy
489value. For example, @code{7675:80} can be used when AS 7675 wants to
490pass local policy value 80 to neighboring peer.
491@item internet
492@code{internet} represents well-known communities value 0.
493@item no-export
494@code{no-export} represents well-known communities value @code{NO_EXPORT}@*
495@r{(0xFFFFFF01)}. All routes carry this value must not be advertised
496to outside a BGP confederation boundary. If neighboring BGP peer is
497part of BGP confederation, the peer is considered as inside a BGP
498confederation boundary, so the route will be announced to the peer.
499@item no-advertise
500@code{no-advertise} represents well-known communities value
501@code{NO_ADVERTISE}@*@r{(0xFFFFFF02)}. All routes carry this value
502must not be advertise to other BGP peers.
503@item local-AS
504@code{local-AS} represents well-known communities value
505@code{NO_EXPORT_SUBCONFED} @r{(0xFFFFFF03)}. All routes carry this
506value must not be advertised to external BGP peers. Even if the
507neighboring router is part of confederation, it is considered as
508external BGP peer, so the route will not be announced to the peer.
509@end table
510
511 When BGP communities attribute is received, duplicated communities
512value in the communities attribute is ignored and each communities
513values are sorted in numerical order.
514
515@menu
516* BGP Community Lists::
517* Numbered BGP Community Lists::
518* BGP Community in Route Map::
519* Display BGP Routes by Community::
520* Using BGP Communities Attribute::
521@end menu
522
paul76b89b42004-11-06 17:13:09 +0000523@node BGP Community Lists
paul718e3742002-12-13 20:15:29 +0000524@subsection BGP Community Lists
525
526 BGP community list is a user defined BGP communites attribute list.
527BGP community list can be used for matching or manipulating BGP
528communities attribute in updates.
529
paulaa5943f2005-11-04 21:53:59 +0000530There are two types of community list. One is standard community
paul718e3742002-12-13 20:15:29 +0000531list and another is expanded community list. Standard community list
532defines communities attribute. Expanded community list defines
533communities attribute string with regular expression. Standard
534community list is compiled into binary format when user define it.
535Standard community list will be directly compared to BGP communities
536attribute in BGP updates. Therefore the comparison is faster than
537expanded community list.
538
539@deffn Command {ip community-list standard @var{name} @{permit|deny@} @var{community}} {}
540This command defines a new standard community list. @var{community}
541is communities value. The @var{community} is compiled into community
542structure. We can define multiple community list under same name. In
543that case match will happen user defined order. Once the
544community list matches to communities attribute in BGP updates it
545return permit or deny by the community list definition. When there is
546no matched entry, deny will be returned. When @var{community} is
547empty it matches to any routes.
548@end deffn
549
550@deffn Command {ip community-list expanded @var{name} @{permit|deny@} @var{line}} {}
551This command defines a new expanded community list. @var{line} is a
552string expression of communities attribute. @var{line} can include
553regular expression to match communities attribute in BGP updates.
554@end deffn
555
556@deffn Command {no ip community-list @var{name}} {}
557@deffnx Command {no ip community-list standard @var{name}} {}
558@deffnx Command {no ip community-list expanded @var{name}} {}
559These commands delete community lists specified by @var{name}. All of
560community lists shares a single name space. So community lists can be
561removed simpley specifying community lists name.
562@end deffn
563
564@deffn {Command} {show ip community-list} {}
565@deffnx {Command} {show ip community-list @var{name}} {}
566This command display current community list information. When
567@var{name} is specified the specified community list's information is
568shown.
569
570@example
571# show ip community-list
572Named Community standard list CLIST
573 permit 7675:80 7675:100 no-export
574 deny internet
575Named Community expanded list EXPAND
576 permit :
577
578# show ip community-list CLIST
579Named Community standard list CLIST
580 permit 7675:80 7675:100 no-export
581 deny internet
582@end example
583@end deffn
584
paul76b89b42004-11-06 17:13:09 +0000585@node Numbered BGP Community Lists
paul718e3742002-12-13 20:15:29 +0000586@subsection Numbered BGP Community Lists
587
paulaa5943f2005-11-04 21:53:59 +0000588When number is used for BGP community list name, the number has
paul718e3742002-12-13 20:15:29 +0000589special meanings. Community list number in the range from 1 and 99 is
590standard community list. Community list number in the range from 100
591to 199 is expanded community list. These community lists are called
592as numbered community lists. On the other hand normal community lists
593is called as named community lists.
594
595@deffn Command {ip community-list <1-99> @{permit|deny@} @var{community}} {}
596This command defines a new community list. <1-99> is standard
597community list number. Community list name within this range defines
598standard community list. When @var{community} is empty it matches to
599any routes.
600@end deffn
601
602@deffn Command {ip community-list <100-199> @{permit|deny@} @var{community}} {}
603This command defines a new community list. <100-199> is expanded
604community list number. Community list name within this range defines
605expanded community list.
606@end deffn
607
608@deffn Command {ip community-list @var{name} @{permit|deny@} @var{community}} {}
609When community list type is not specifed, the community list type is
610automatically detected. If @var{community} can be compiled into
611communities attribute, the community list is defined as a standard
612community list. Otherwise it is defined as an expanded community
613list. This feature is left for backward compability. Use of this
614feature is not recommended.
615@end deffn
616
paul76b89b42004-11-06 17:13:09 +0000617@node BGP Community in Route Map
paul718e3742002-12-13 20:15:29 +0000618@subsection BGP Community in Route Map
619
paulaa5943f2005-11-04 21:53:59 +0000620In Route Map (@pxref{Route Map}), we can match or set BGP
paul718e3742002-12-13 20:15:29 +0000621communities attribute. Using this feature network operator can
622implement their network policy based on BGP communities attribute.
623
paulaa5943f2005-11-04 21:53:59 +0000624Following commands can be used in Route Map.
paul718e3742002-12-13 20:15:29 +0000625
626@deffn {Route Map} {match community @var{word}} {}
627@deffnx {Route Map} {match community @var{word} exact-match} {}
628This command perform match to BGP updates using community list
629@var{word}. When the one of BGP communities value match to the one of
630communities value in community list, it is match. When
631@code{exact-match} keyword is spcified, match happen only when BGP
632updates have completely same communities value specified in the
633community list.
634@end deffn
635
636@deffn {Route Map} {set community none} {}
637@deffnx {Route Map} {set community @var{community}} {}
638@deffnx {Route Map} {set community @var{community} additive} {}
639This command manipulate communities value in BGP updates. When
640@code{none} is specified as communities value, it removes entire
641communities attribute from BGP updates. When @var{community} is not
642@code{none}, specified communities value is set to BGP updates. If
643BGP updates already has BGP communities value, the existing BGP
644communities value is replaced with specified @var{community} value.
645When @code{additive} keyword is specified, @var{community} is appended
646to the existing communities value.
647@end deffn
648
649@deffn {Route Map} {set comm-list @var{word} delete} {}
650This command remove communities value from BGP communities attribute.
651The @var{word} is community list name. When BGP route's communities
652value matches to the community list @var{word}, the communities value
653is removed. When all of communities value is removed eventually, the
654BGP update's communities attribute is completely removed.
655@end deffn
656
paul76b89b42004-11-06 17:13:09 +0000657@node Display BGP Routes by Community
paul718e3742002-12-13 20:15:29 +0000658@subsection Display BGP Routes by Community
659
paulaa5943f2005-11-04 21:53:59 +0000660To show BGP routes which has specific BGP communities attribute,
paul718e3742002-12-13 20:15:29 +0000661@code{show ip bgp} command can be used. The @var{community} value and
662community list can be used for @code{show ip bgp} command.
663
664@deffn Command {show ip bgp community} {}
665@deffnx Command {show ip bgp community @var{community}} {}
666@deffnx Command {show ip bgp community @var{community} exact-match} {}
667@code{show ip bgp community} displays BGP routes which has communities
668attribute. When @var{community} is specified, BGP routes that matches
669@var{community} value is displayed. For this command, @code{internet}
670keyword can't be used for @var{community} value. When
671@code{exact-match} is specified, it display only routes that have an
672exact match.
673@end deffn
674
675@deffn Command {show ip bgp community-list @var{word}} {}
676@deffnx Command {show ip bgp community-list @var{word} exact-match} {}
677This commands display BGP routes that matches community list
678@var{word}. When @code{exact-match} is specified, display only routes
679that have an exact match.
680@end deffn
681
paul76b89b42004-11-06 17:13:09 +0000682@node Using BGP Communities Attribute
paul718e3742002-12-13 20:15:29 +0000683@subsection Using BGP Communities Attribute
684
paulaa5943f2005-11-04 21:53:59 +0000685Following configuration is the most typical usage of BGP communities
paul718e3742002-12-13 20:15:29 +0000686attribute. AS 7675 provides upstream Internet connection to AS 100.
687When following configuration exists in AS 7675, AS 100 networks
688operator can set local preference in AS 7675 network by setting BGP
689communities attribute to the updates.
690
691@example
692router bgp 7675
693 neighbor 192.168.0.1 remote-as 100
694 neighbor 192.168.0.1 route-map RMAP in
695!
696ip community-list 70 permit 7675:70
697ip community-list 70 deny
698ip community-list 80 permit 7675:80
699ip community-list 80 deny
700ip community-list 90 permit 7675:90
701ip community-list 90 deny
702!
703route-map RMAP permit 10
704 match community 70
705 set local-preference 70
706!
707route-map RMAP permit 20
708 match community 80
709 set local-preference 80
710!
711route-map RMAP permit 30
712 match community 90
713 set local-preference 90
714@end example
715
paulaa5943f2005-11-04 21:53:59 +0000716Following configuration announce 10.0.0.0/8 from AS 100 to AS 7675.
paul718e3742002-12-13 20:15:29 +0000717The route has communities value 7675:80 so when above configuration
718exists in AS 7675, announced route's local preference will be set to
719value 80.
720
721@example
722router bgp 100
723 network 10.0.0.0/8
724 neighbor 192.168.0.2 remote-as 7675
725 neighbor 192.168.0.2 route-map RMAP out
726!
727ip prefix-list PLIST permit 10.0.0.0/8
728!
729route-map RMAP permit 10
730 match ip address prefix-list PLIST
731 set community 7675:80
732@end example
733
paulaa5943f2005-11-04 21:53:59 +0000734Following configuration is an example of BGP route filtering using
paul718e3742002-12-13 20:15:29 +0000735communities attribute. This configuration only permit BGP routes
736which has BGP communities value 0:80 or 0:90. Network operator can
737put special internal communities value at BGP border router, then
738limit the BGP routes announcement into the internal network.
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 1 permit 0:80 0:90
746!
747route-map RMAP permit in
748 match community 1
749@end example
750
paulaa5943f2005-11-04 21:53:59 +0000751Following exmaple filter BGP routes which has communities value 1:1.
paul718e3742002-12-13 20:15:29 +0000752When there is no match community-list returns deny. To avoid
753filtering all of routes, we need to define permit any at last.
754
755@example
756router bgp 7675
757 neighbor 192.168.0.1 remote-as 100
758 neighbor 192.168.0.1 route-map RMAP in
759!
760ip community-list standard FILTER deny 1:1
761ip community-list standard FILTER permit
762!
763route-map RMAP permit 10
764 match community FILTER
765@end example
766
paulaa5943f2005-11-04 21:53:59 +0000767Communities value keyword @code{internet} has special meanings in
paul718e3742002-12-13 20:15:29 +0000768standard community lists. In below example @code{internet} act as
769match any. It matches all of BGP routes even if the route does not
770have communities attribute at all. So community list @code{INTERNET}
771is same as above example's @code{FILTER}.
772
773@example
774ip community-list standard INTERNET deny 1:1
775ip community-list standard INTERNET permit internet
776@end example
777
paulaa5943f2005-11-04 21:53:59 +0000778Following configuration is an example of communities value deletion.
paul718e3742002-12-13 20:15:29 +0000779With this configuration communities value 100:1 and 100:2 is removed
780from BGP updates. For communities value deletion, only @code{permit}
781community-list is used. @code{deny} community-list is ignored.
782
783@example
784router bgp 7675
785 neighbor 192.168.0.1 remote-as 100
786 neighbor 192.168.0.1 route-map RMAP in
787!
788ip community-list standard DEL permit 100:1 100:2
789!
790route-map RMAP permit 10
791 set comm-list DEL delete
792@end example
793
794@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000795@node BGP Extended Communities Attribute
paul718e3742002-12-13 20:15:29 +0000796@section BGP Extended Communities Attribute
797
paulaa5943f2005-11-04 21:53:59 +0000798BGP extended communities attribute is introduced with MPLS VPN/BGP
paul718e3742002-12-13 20:15:29 +0000799technology. MPLS VPN/BGP expands capability of network infrastructure
800to provide VPN functionality. At the same time it requires a new
801framework for policy routing. With BGP Extended Communities Attribute
802we can use Route Target or Site of Origin for implementing network
803policy for MPLS VPN/BGP.
804
paulaa5943f2005-11-04 21:53:59 +0000805BGP Extended Communities Attribute is similar to BGP Communities
paul718e3742002-12-13 20:15:29 +0000806Attribute. It is an optional transitive attribute. BGP Extended
807Communities Attribute can carry multiple Extended Community value.
808Each Extended Community value is eight octet length.
809
paulaa5943f2005-11-04 21:53:59 +0000810BGP Extended Communities Attribute provides an extended range
paul718e3742002-12-13 20:15:29 +0000811compared with BGP Communities Attribute. Adding to that there is a
812type field in each value to provides community space structure.
813
paulaa5943f2005-11-04 21:53:59 +0000814There are two format to define Extended Community value. One is AS
paul718e3742002-12-13 20:15:29 +0000815based format the other is IP address based format.
816
817@table @code
818@item AS:VAL
819This is a format to define AS based Extended Community value.
820@code{AS} part is 2 octets Global Administrator subfield in Extended
821Community value. @code{VAL} part is 4 octets Local Administrator
822subfield. @code{7675:100} represents AS 7675 policy value 100.
823@item IP-Address:VAL
824This is a format to define IP address based Extended Community value.
825@code{IP-Address} part is 4 octets Global Administrator subfield.
826@code{VAL} part is 2 octets Local Administrator subfield.
827@code{10.0.0.1:100} represents
828@end table
829
830@menu
831* BGP Extended Community Lists::
832* BGP Extended Communities in Route Map::
833@end menu
834
paul76b89b42004-11-06 17:13:09 +0000835@node BGP Extended Community Lists
paul718e3742002-12-13 20:15:29 +0000836@subsection BGP Extended Community Lists
837
paulaa5943f2005-11-04 21:53:59 +0000838Expanded Community Lists is a user defined BGP Expanded Community
paul718e3742002-12-13 20:15:29 +0000839Lists.
840
841@deffn Command {ip extcommunity-list standard @var{name} @{permit|deny@} @var{extcommunity}} {}
842This command defines a new standard extcommunity-list.
843@var{extcommunity} is extended communities value. The
844@var{extcommunity} is compiled into extended community structure. We
845can define multiple extcommunity-list under same name. In that case
846match will happen user defined order. Once the extcommunity-list
847matches to extended communities attribute in BGP updates it return
848permit or deny based upon the extcommunity-list definition. When
849there is no matched entry, deny will be returned. When
850@var{extcommunity} is empty it matches to any routes.
851@end deffn
852
853@deffn Command {ip extcommunity-list expanded @var{name} @{permit|deny@} @var{line}} {}
854This command defines a new expanded extcommunity-list. @var{line} is
855a string expression of extended communities attribute. @var{line} can
856include regular expression to match extended communities attribute in
857BGP updates.
858@end deffn
859
860@deffn Command {no ip extcommunity-list @var{name}} {}
861@deffnx Command {no ip extcommunity-list standard @var{name}} {}
862@deffnx Command {no ip extcommunity-list expanded @var{name}} {}
863These commands delete extended community lists specified by
864@var{name}. All of extended community lists shares a single name
865space. So extended community lists can be removed simpley specifying
866the name.
867@end deffn
868
869@deffn {Command} {show ip extcommunity-list} {}
870@deffnx {Command} {show ip extcommunity-list @var{name}} {}
871This command display current extcommunity-list information. When
872@var{name} is specified the community list's information is shown.
873
874@example
875# show ip extcommunity-list
876@end example
877@end deffn
878
paul76b89b42004-11-06 17:13:09 +0000879@node BGP Extended Communities in Route Map
paul718e3742002-12-13 20:15:29 +0000880@subsection BGP Extended Communities in Route Map
881
882@deffn {Route Map} {match extcommunity @var{word}} {}
883@end deffn
884
885@deffn {Route Map} {set extcommunity rt @var{extcommunity}} {}
886This command set Route Target value.
887@end deffn
888
889@deffn {Route Map} {set extcommunity soo @var{extcommunity}} {}
890This command set Site of Origin value.
891@end deffn
892
893@c -----------------------------------------------------------------------
paul76b89b42004-11-06 17:13:09 +0000894@node Displaying BGP routes
paul718e3742002-12-13 20:15:29 +0000895@section Displaying BGP Routes
896
897@menu
898* Show IP BGP::
899* More Show IP BGP::
900@end menu
901
paul76b89b42004-11-06 17:13:09 +0000902@node Show IP BGP
paul718e3742002-12-13 20:15:29 +0000903@subsection Show IP BGP
904
905@deffn {Command} {show ip bgp} {}
906@deffnx {Command} {show ip bgp @var{A.B.C.D}} {}
907@deffnx {Command} {show ip bgp @var{X:X::X:X}} {}
908This command displays BGP routes. When no route is specified it
909display all of IPv4 BGP routes.
910@end deffn
911
912@example
913BGP table version is 0, local router ID is 10.1.1.1
914Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
915Origin codes: i - IGP, e - EGP, ? - incomplete
916
917 Network Next Hop Metric LocPrf Weight Path
918*> 1.1.1.1/32 0.0.0.0 0 32768 i
919
920Total number of prefixes 1
921@end example
922
paul76b89b42004-11-06 17:13:09 +0000923@node More Show IP BGP
paul718e3742002-12-13 20:15:29 +0000924@subsection More Show IP BGP
925
926@deffn {Command} {show ip bgp regexp @var{line}} {}
927This command display BGP routes using AS path regular expression (@pxref{Display BGP Routes by AS Path}).
928@end deffn
929
930@deffn Command {show ip bgp community @var{community}} {}
931@deffnx Command {show ip bgp community @var{community} exact-match} {}
932This command display BGP routes using @var{community} (@pxref{Display
933BGP Routes by Community}).
934@end deffn
935
936@deffn Command {show ip bgp community-list @var{word}} {}
937@deffnx Command {show ip bgp community-list @var{word} exact-match} {}
938This command display BGP routes using community list (@pxref{Display
939BGP Routes by Community}).
940@end deffn
941
942@deffn {Command} {show ip bgp summary} {}
943@end deffn
944
945@deffn {Command} {show ip bgp neighbor [@var{peer}]} {}
946@end deffn
947
948@deffn {Command} {clear ip bgp @var{peer}} {}
949Clear peers which have addresses of X.X.X.X
950@end deffn
951
952@deffn {Command} {clear ip bgp @var{peer} soft in} {}
953Clear peer using soft reconfiguration.
954@end deffn
955
956@deffn {Command} {show debug} {}
957@end deffn
958
959@deffn {Command} {debug event} {}
960@end deffn
961
962@deffn {Command} {debug update} {}
963@end deffn
964
965@deffn {Command} {debug keepalive} {}
966@end deffn
967
968@deffn {Command} {no debug event} {}
969@end deffn
970
971@deffn {Command} {no debug update} {}
972@end deffn
973
974@deffn {Command} {no debug keepalive} {}
975@end deffn
976
paul76b89b42004-11-06 17:13:09 +0000977@node Capability Negotiation
paul718e3742002-12-13 20:15:29 +0000978@section Capability Negotiation
979
paulaa5943f2005-11-04 21:53:59 +0000980When adding IPv6 routing information exchange feature to BGP. There
981were some proposals. @acronym{IETF,Internet Engineering Task Force}
982@acronym{IDR, Inter Domain Routing} @acronym{WG, Working group} adopted
983a proposal called Multiprotocol Extension for BGP. The specification
984is described in @cite{RFC2283}. The protocol does not define new protocols.
985It defines new attributes to existing BGP. When it is used exchanging
986IPv6 routing information it is called BGP-4+. When it is used for
987exchanging multicast routing information it is called MBGP.
paul718e3742002-12-13 20:15:29 +0000988
paulaa5943f2005-11-04 21:53:59 +0000989@command{bgpd} supports Multiprotocol Extension for BGP. So if remote
990peer supports the protocol, @command{bgpd} can exchange IPv6 and/or
991multicast routing information.
paul718e3742002-12-13 20:15:29 +0000992
paulaa5943f2005-11-04 21:53:59 +0000993Traditional BGP did not have the feature to detect remote peer's
994capabilities, e.g. whether it can handle prefix types other than IPv4
995unicast routes. This was a big problem using Multiprotocol Extension
996for BGP to operational network. @cite{RFC2842, Capabilities
997Advertisement with BGP-4} adopted a feature called Capability
998Negotiation. @command{bgpd} use this Capability Negotiation to detect
999the remote peer's capabilities. If the peer is only configured as IPv4
1000unicast neighbor, @command{bgpd} does not send these Capability
1001Negotiation packets (at least not unless other optional BGP features
1002require capability negotation).
paul718e3742002-12-13 20:15:29 +00001003
paulaa5943f2005-11-04 21:53:59 +00001004By default, Quagga will bring up peering with minimal common capability
1005for the both sides. For example, local router has unicast and
1006multicast capabilitie and remote router has unicast capability. In
1007this case, the local router will establish the connection with unicast
1008only capability. When there are no common capabilities, Quagga sends
1009Unsupported Capability error and then resets the connection.
paul718e3742002-12-13 20:15:29 +00001010
paulaa5943f2005-11-04 21:53:59 +00001011If you want to completely match capabilities with remote peer. Please
paul718e3742002-12-13 20:15:29 +00001012use @command{strict-capability-match} command.
1013
1014@deffn {BGP} {neighbor @var{peer} strict-capability-match} {}
1015@deffnx {BGP} {no neighbor @var{peer} strict-capability-match} {}
1016Strictly compares remote capabilities and local capabilities. If capabilities
1017are different, send Unsupported Capability error then reset connection.
1018@end deffn
1019
paulaa5943f2005-11-04 21:53:59 +00001020You may want to disable sending Capability Negotiation OPEN message
paul718e3742002-12-13 20:15:29 +00001021optional parameter to the peer when remote peer does not implement
1022Capability Negotiation. Please use @command{dont-capability-negotiate}
1023command to disable the feature.
1024
1025@deffn {BGP} {neighbor @var{peer} dont-capability-negotiate} {}
1026@deffnx {BGP} {no neighbor @var{peer} dont-capability-negotiate} {}
1027Suppress sending Capability Negotiation as OPEN message optional
1028parameter to the peer. This command only affects the peer is configured
1029other than IPv4 unicast configuration.
1030@end deffn
1031
paulaa5943f2005-11-04 21:53:59 +00001032When remote peer does not have capability negotiation feature, remote
1033peer will not send any capabilities at all. In that case, bgp
1034configures the peer with configured capabilities.
paul718e3742002-12-13 20:15:29 +00001035
paulaa5943f2005-11-04 21:53:59 +00001036You may prefer locally configured capabilities more than the negotiated
1037capabilities even though remote peer sends capabilities. If the peer
1038is configured by @command{override-capability}, @command{bgpd} ignores
1039received capabilities then override negotiated capabilities with
1040configured values.
paul718e3742002-12-13 20:15:29 +00001041
1042@deffn {BGP} {neighbor @var{peer} override-capability} {}
1043@deffnx {BGP} {no neighbor @var{peer} override-capability} {}
1044Override the result of Capability Negotiation with local configuration.
1045Ignore remote peer's capability value.
1046@end deffn
1047
paul76b89b42004-11-06 17:13:09 +00001048@node Route Reflector
paul718e3742002-12-13 20:15:29 +00001049@section Route Reflector
1050
1051@deffn {BGP} {bgp cluster-id @var{a.b.c.d}} {}
1052@end deffn
1053
1054@deffn {BGP} {neighbor @var{peer} route-reflector-client} {}
1055@deffnx {BGP} {no neighbor @var{peer} route-reflector-client} {}
1056@end deffn
1057
paul76b89b42004-11-06 17:13:09 +00001058@node Route Server
paul718e3742002-12-13 20:15:29 +00001059@section Route Server
1060
1061At an Internet Exchange point, many ISPs are connected to each other by
1062external BGP peering. Normally these external BGP connection are done by
paulaa5943f2005-11-04 21:53:59 +00001063@samp{full mesh} method. As with internal BGP full mesh formation,
paul718e3742002-12-13 20:15:29 +00001064this method has a scaling problem.
1065
1066This scaling problem is well known. Route Server is a method to resolve
1067the problem. Each ISP's BGP router only peers to Route Server. Route
1068Server serves as BGP information exchange to other BGP routers. By
1069applying this method, numbers of BGP connections is reduced from
1070O(n*(n-1)/2) to O(n).
1071
1072Unlike normal BGP router, Route Server must have several routing tables
1073for managing different routing policies for each BGP speaker. We call the
1074routing tables as different @code{view}s. @command{bgpd} can work as
1075normal BGP router or Route Server or both at the same time.
1076
1077@menu
1078* Multiple instance::
1079* BGP instance and view::
1080* Routing policy::
1081* Viewing the view::
1082@end menu
1083
paul76b89b42004-11-06 17:13:09 +00001084@node Multiple instance
paul718e3742002-12-13 20:15:29 +00001085@subsection Multiple instance
1086
1087To enable multiple view function of @code{bgpd}, you must turn on
1088multiple instance feature beforehand.
1089
1090@deffn {Command} {bgp multiple-instance} {}
1091Enable BGP multiple instance feature. After this feature is enabled,
1092you can make multiple BGP instances or multiple BGP views.
1093@end deffn
1094
1095@deffn {Command} {no bgp multiple-instance} {}
1096Disable BGP multiple instance feature. You can not disable this feature
1097when BGP multiple instances or views exist.
1098@end deffn
1099
1100When you want to make configuration more Cisco like one,
1101
1102@deffn {Command} {bgp config-type cisco} {}
1103Cisco compatible BGP configuration output.
1104@end deffn
1105
1106When bgp config-type cisco is specified,
1107
1108``no synchronization'' is displayed.
1109``no auto-summary'' is desplayed.
1110
1111``network'' and ``aggregate-address'' argument is displayed as
1112``A.B.C.D M.M.M.M''
1113
paul7190f4e2003-08-12 12:40:20 +00001114Quagga: network 10.0.0.0/8
paul718e3742002-12-13 20:15:29 +00001115Cisco: network 10.0.0.0
1116
paul7190f4e2003-08-12 12:40:20 +00001117Quagga: aggregate-address 192.168.0.0/24
paul718e3742002-12-13 20:15:29 +00001118Cisco: aggregate-address 192.168.0.0 255.255.255.0
1119
1120Community attribute handling is also different. If there is no
1121configuration is specified community attribute and extended community
1122attribute are sent to neighbor. When user manually disable the
1123feature community attribute is not sent to the neighbor. In case of
paulaa5943f2005-11-04 21:53:59 +00001124@command{bgp config-type cisco} is specified, community attribute is not
paul718e3742002-12-13 20:15:29 +00001125sent to the neighbor by default. To send community attribute user has
paulaa5943f2005-11-04 21:53:59 +00001126to specify @command{neighbor A.B.C.D send-community} command.
paul718e3742002-12-13 20:15:29 +00001127
paulaa5943f2005-11-04 21:53:59 +00001128@example
paul718e3742002-12-13 20:15:29 +00001129!
1130router bgp 1
1131 neighbor 10.0.0.1 remote-as 1
1132 no neighbor 10.0.0.1 send-community
1133!
paul718e3742002-12-13 20:15:29 +00001134router bgp 1
1135 neighbor 10.0.0.1 remote-as 1
1136 neighbor 10.0.0.1 send-community
1137!
paulaa5943f2005-11-04 21:53:59 +00001138@end example
paul718e3742002-12-13 20:15:29 +00001139
1140@deffn {Command} {bgp config-type zebra} {}
paul7190f4e2003-08-12 12:40:20 +00001141Quagga style BGP configuration. This is default.
paul718e3742002-12-13 20:15:29 +00001142@end deffn
1143
paul76b89b42004-11-06 17:13:09 +00001144@node BGP instance and view
paul718e3742002-12-13 20:15:29 +00001145@subsection BGP instance and view
1146
1147BGP instance is a normal BGP process. The result of route selection
1148goes to the kernel routing table. You can setup different AS at the
1149same time when BGP multiple instance feature is enabled.
1150
1151@deffn {Command} {router bgp @var{as-number}} {}
1152Make a new BGP instance. You can use arbitrary word for the @var{name}.
1153@end deffn
1154
1155@example
1156@group
1157bgp multiple-instance
1158!
1159router bgp 1
1160 neighbor 10.0.0.1 remote-as 2
1161 neighbor 10.0.0.2 remote-as 3
1162!
1163router bgp 2
1164 neighbor 10.0.0.3 remote-as 4
1165 neighbor 10.0.0.4 remote-as 5
1166@end group
1167@end example
1168
1169BGP view is almost same as normal BGP process. The result of
1170route selection does not go to the kernel routing table. BGP view is
1171only for exchanging BGP routing information.
1172
1173@deffn {Command} {router bgp @var{as-number} view @var{name}} {}
1174Make a new BGP view. You can use arbitrary word for the @var{name}. This
1175view's route selection result does not go to the kernel routing table.
1176@end deffn
1177
1178With this command, you can setup Route Server like below.
1179
1180@example
1181@group
1182bgp multiple-instance
1183!
1184router bgp 1 view 1
1185 neighbor 10.0.0.1 remote-as 2
1186 neighbor 10.0.0.2 remote-as 3
1187!
1188router bgp 2 view 2
1189 neighbor 10.0.0.3 remote-as 4
1190 neighbor 10.0.0.4 remote-as 5
1191@end group
1192@end example
1193
paul76b89b42004-11-06 17:13:09 +00001194@node Routing policy
paul718e3742002-12-13 20:15:29 +00001195@subsection Routing policy
1196
1197You can set different routing policy for a peer. For example, you can
1198set different filter for a peer.
1199
1200@example
1201@group
1202bgp multiple-instance
1203!
1204router bgp 1 view 1
1205 neighbor 10.0.0.1 remote-as 2
1206 neighbor 10.0.0.1 distribute-list 1 in
1207!
1208router bgp 1 view 2
1209 neighbor 10.0.0.1 remote-as 2
1210 neighbor 10.0.0.1 distribute-list 2 in
1211@end group
1212@end example
1213
1214This means BGP update from a peer 10.0.0.1 goes to both BGP view 1 and view
12152. When the update is inserted into view 1, distribute-list 1 is
1216applied. On the other hand, when the update is inserted into view 2,
1217distribute-list 2 is applied.
1218
paul76b89b42004-11-06 17:13:09 +00001219@node Viewing the view
paul718e3742002-12-13 20:15:29 +00001220@subsection Viewing the view
1221
1222To display routing table of BGP view, you must specify view name.
1223
1224@deffn {Command} {show ip bgp view @var{name}} {}
1225Display routing table of BGP view @var{name}.
1226@end deffn
1227
paul76b89b42004-11-06 17:13:09 +00001228@node How to set up a 6-Bone connection
paul718e3742002-12-13 20:15:29 +00001229@section How to set up a 6-Bone connection
1230
paul6a22b1f2004-11-07 19:39:13 +00001231
paul718e3742002-12-13 20:15:29 +00001232@example
1233@group
1234zebra configuration
1235===================
1236!
1237! Actually there is no need to configure zebra
1238!
1239
1240bgpd configuration
1241==================
1242!
1243! This means that routes go through zebra and into the kernel.
1244!
1245router zebra
1246!
1247! MP-BGP configuration
1248!
1249router bgp 7675
1250 bgp router-id 10.0.0.1
1251 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 remote-as @var{as-number}
1252!
1253 address-family ipv6
1254 network 3ffe:506::/32
1255 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 activate
1256 neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 route-map set-nexthop out
1257 neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 remote-as @var{as-number}
1258 neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 route-map set-nexthop out
1259 exit-address-family
1260!
1261ipv6 access-list all permit any
1262!
1263! Set output nexthop address.
1264!
1265route-map set-nexthop permit 10
1266 match ipv6 address all
1267 set ipv6 nexthop global 3ffe:1cfa:0:2:2c0:4fff:fe68:a225
1268 set ipv6 nexthop local fe80::2c0:4fff:fe68:a225
1269!
1270! logfile FILENAME is obsolete. Please use log file FILENAME
paul7190f4e2003-08-12 12:40:20 +00001271
paul718e3742002-12-13 20:15:29 +00001272log file bgpd.log
1273!
1274@end group
1275@end example
1276
paul76b89b42004-11-06 17:13:09 +00001277@node Dump BGP packets and table
paul718e3742002-12-13 20:15:29 +00001278@section Dump BGP packets and table
1279
1280@deffn Command {dump bgp all @var{path}} {}
1281@deffnx Command {dump bgp all @var{path} @var{interval}} {}
1282Dump all BGP packet and events to @var{path} file.
1283@end deffn
1284
1285@deffn Command {dump bgp updates @var{path}} {}
1286@deffnx Command {dump bgp updates @var{path} @var{interval}} {}
1287Dump BGP updates to @var{path} file.
1288@end deffn
1289
1290@deffn Command {dump bgp routes @var{path}} {}
1291@deffnx Command {dump bgp routes @var{path}} {}
1292Dump whole BGP routing table to @var{path}. This is heavy process.
1293@end deffn
paulaa5943f2005-11-04 21:53:59 +00001294
1295@node BGP Configuration Examples
1296@section BGP Configuration Examples
1297
1298Example of a session to an upstream, advertising only one prefix to it.
1299
1300@example
1301router bgp 64512
1302 bgp router-id 10.236.87.1
1303 network 10.236.87.0/24
1304 neighbor upstream peer-group
1305 neighbor upstream remote-as 64515
1306 neighbor upstream capability dynamic
1307 neighbor upstream prefix-list pl-allowed-adv out
1308 neighbor 10.1.1.1 peer-group upstream
1309 neighbor 10.1.1.1 description ACME ISP
1310!
1311ip prefix-list pl-allowed-adv seq 5 permit 82.195.133.0/25
1312ip prefix-list pl-allowed-adv seq 10 deny any
1313
1314@end example
1315
1316A more complex example. With upstream, peer and customer sessions.
1317Advertising global prefixes and NO_EXPORT prefixes and providing
1318actions for customer routes based on community values. Extensive use of
1319route-maps and the 'call' feature to support selective advertising of
1320prefixes. This example is intended as guidance only, it has NOT been
1321tested and almost certainly containts silly mistakes, if not serious
1322flaws.
1323
1324@example
1325router bgp 64512
1326 bgp router-id 10.236.87.1
1327 network 10.123.456.0/24
1328 network 10.123.456.128/25 route-map rm-no-export
1329 neighbor upstream capability dynamic
1330 neighbor upstream route-map rm-upstream-out out
1331 neighbor cust capability dynamic
1332 neighbor cust route-map rm-cust-in in
1333 neighbor cust route-map rm-cust-out out
1334 neighbor cust send-community both
1335 neighbor peer capability dynamic
1336 neighbor peer route-map rm-peer-in in
1337 neighbor peer route-map rm-peer-out out
1338 neighbor peer send-community both
1339 neighbor 10.1.1.1 remote-as 64515
1340 neighbor 10.1.1.1 peer-group upstream
1341 neighbor 10.2.1.1 remote-as 64516
1342 neighbor 10.2.1.1 peer-group upstream
1343 neighbor 10.3.1.1 remote-as 64517
1344 neighbor 10.3.1.1 peer-group cust-default
1345 neighbor 10.3.1.1 description customer1
1346 neighbor 10.3.1.1 prefix-list pl-cust1-network in
1347 neighbor 10.4.1.1 remote-as 64518
1348 neighbor 10.4.1.1 peer-group cust
1349 neighbor 10.4.1.1 prefix-list pl-cust2-network in
1350 neighbor 10.4.1.1 description customer2
1351 neighbor 10.5.1.1 remote-as 64519
1352 neighbor 10.5.1.1 peer-group peer
1353 neighbor 10.5.1.1 prefix-list pl-peer1-network in
1354 neighbor 10.5.1.1 description peer AS 1
1355 neighbor 10.6.1.1 remote-as 64520
1356 neighbor 10.6.1.1 peer-group peer
1357 neighbor 10.6.1.1 prefix-list pl-peer2-network in
1358 neighbor 10.6.1.1 description peer AS 2
1359!
1360ip prefix-list pl-default permit 0.0.0.0/0
1361!
1362ip prefix-list pl-upstream-peers permit 10.1.1.1/32
1363ip prefix-list pl-upstream-peers permit 10.2.1.1/32
1364!
1365ip prefix-list pl-cust1-network permit 10.3.1.0/24
1366ip prefix-list pl-cust1-network permit 10.3.2.0/24
1367!
1368ip prefix-list pl-cust2-network permit 10.4.1.0/24
1369!
1370ip prefix-list pl-peer1-network permit 10.5.1.0/24
1371ip prefix-list pl-peer1-network permit 10.5.2.0/24
1372ip prefix-list pl-peer1-network permit 192.168.0.0/24
1373!
1374ip prefix-list pl-peer2-network permit 10.6.1.0/24
1375ip prefix-list pl-peer2-network permit 10.6.2.0/24
1376ip prefix-list pl-peer2-network permit 192.168.1.0/24
1377ip prefix-list pl-peer2-network permit 192.168.2.0/24
1378ip prefix-list pl-peer2-network permit 172.16.1/24
1379!
1380ip as-path access-list asp-own-as permit ^$
1381ip as-path access-list asp-own-as permit _64512_
1382!
1383! #################################################################
1384! Match communities we provide actions for, on routes receives from
1385! customers. Communities values of <our-ASN>:X, with X, have actions:
1386!
1387! 100 - blackhole the prefix
1388! 200 - set no_export
1389! 300 - advertise only to other customers
1390! 400 - advertise only to upstreams
1391! 500 - set no_export when advertising to upstreams
1392! 2X00 - set local_preference to X00
1393!
1394! blackhole the prefix of the route
1395ip community-list standard cm-blackhole permit 64512:100
1396!
1397! set no-export community before advertising
1398ip community-list standard cm-set-no-export permit 64512:200
1399!
1400! advertise only to other customers
1401ip community-list standard cm-cust-only permit 64512:300
1402!
1403! advertise only to upstreams
1404ip community-list standard cm-upstream-only permit 64512:400
1405!
1406! advertise to upstreams with no-export
1407ip community-list standard cm-upstream-noexport permit 64512:500
1408!
1409! set local-pref to least significant 3 digits of the community
1410ip community-list standard cm-prefmod-100 permit 64512:2100
1411ip community-list standard cm-prefmod-200 permit 64512:2200
1412ip community-list standard cm-prefmod-300 permit 64512:2300
1413ip community-list standard cm-prefmod-400 permit 64512:2400
1414ip community-list expanded cme-prefmod-range permit 64512:2...
1415!
1416! Informational communities
1417!
1418! 3000 - learned from upstream
1419! 3100 - learned from customer
1420! 3200 - learned from peer
1421!
1422ip community-list standard cm-learnt-upstream permit 64512:3000
1423ip community-list standard cm-learnt-cust permit 64512:3100
1424ip community-list standard cm-learnt-peer permit 64512:3200
1425!
1426! ###################################################################
1427! Utility route-maps
1428!
1429! These utility route-maps generally should not used to permit/deny
1430! routes, i.e. they do not have meaning as filters, and hence probably
1431! should be used with 'on-match next'. These all finish with an empty
1432! permit entry so as not interfere with processing in the caller.
1433!
1434route-map rm-no-export permit 10
1435 set community additive no-export
1436route-map rm-no-export permit 20
1437!
1438route-map rm-blackhole permit 10
1439 description blackhole, up-pref and ensure it cant escape this AS
1440 set ip next-hop 127.0.0.1
1441 set local-preference 10
1442 set community additive no-export
1443route-map rm-blackhole permit 20
1444!
1445! Set local-pref as requested
1446route-map rm-prefmod permit 10
1447 match community cm-prefmod-100
1448 set local-preference 100
1449route-map rm-prefmod permit 20
1450 match community cm-prefmod-200
1451 set local-preference 200
1452route-map rm-prefmod permit 30
1453 match community cm-prefmod-300
1454 set local-preference 300
1455route-map rm-prefmod permit 40
1456 match community cm-prefmod-400
1457 set local-preference 400
1458route-map rm-prefmod permit 50
1459!
1460! Community actions to take on receipt of route.
1461route-map rm-community-in permit 10
1462 description check for blackholing, no point continuing if it matches.
1463 match community cm-blackhole
1464 call rm-blackhole
1465route-map rm-community-in permit 20
1466 match community cm-set-no-export
1467 call rm-no-export
1468 on-match next
1469route-map rm-community-in permit 30
1470 match community cme-prefmod-range
1471 call rm-prefmod
1472route-map rm-community-in permit 40
1473!
1474! #####################################################################
1475! Community actions to take when advertising a route.
1476! These are filtering route-maps,
1477!
1478! Deny customer routes to upstream with cust-only set.
1479route-map rm-community-filt-to-upstream deny 10
1480 match community cm-learnt-cust
1481 match community cm-cust-only
1482route-map rm-community-filt-to-upstream permit 20
1483!
1484! Deny customer routes to other customers with upstream-only set.
1485route-map rm-community-filt-to-cust deny 10
1486 match community cm-learnt-cust
1487 match community cm-upstream-only
1488route-map rm-community-filt-to-cust permit 20
1489!
1490! ###################################################################
1491! The top-level route-maps applied to sessions. Further entries could
1492! be added obviously..
1493!
1494! Customers
1495route-map rm-cust-in permit 10
1496 call rm-community-in
1497 on-match next
1498route-map rm-cust-in permit 20
1499 set community additive 64512:3100
1500route-map rm-cust-in permit 30
1501!
1502route-map rm-cust-out permit 10
1503 call rm-community-filt-to-cust
1504 on-match next
1505route-map rm-cust-out permit 20
1506!
1507! Upstream transit ASes
1508route-map rm-upstream-out permit 10
1509 description filter customer prefixes which are marked cust-only
1510 call rm-community-filt-to-upstream
1511 on-match next
1512route-map rm-upstream-out permit 20
1513 description only customer routes are provided to upstreams/peers
1514 match community cm-learnt-cust
1515!
1516! Peer ASes
1517! outbound policy is same as for upstream
1518route-map rm-peer-out permit 10
1519 call rm-upstream-out
1520!
1521route-map rm-peer-in permit 10
1522 set community additive 64512:3200
1523@end example