2 @c @value{COPYRIGHT_STR}
3 @c See file quagga.texi for copying conditions.
5 @c This file is a modified version of Jose Luis Rubio's TeX sources
6 @c of his RS-Manual document
8 @node Configuring Quagga as a Route Server
9 @chapter Configuring Quagga as a Route Server
11 The purpose of a Route Server is to centralize the peerings between BGP
12 speakers. For example if we have an exchange point scenario with four BGP
13 speakers, each of which maintaining a BGP peering with the other three
14 we can convert it into a centralized scenario where
15 each of the four establishes a single BGP peering against the Route Server.
17 We will first describe briefly the Route Server model implemented by Quagga.
18 We will explain the commands that have been added for configuring that
19 model. And finally we will show a full example of Quagga configured as Route
23 * Description of the Route Server model::
24 * Commands for configuring a Route Server::
25 * Example of Route Server Configuration::
28 @node Description of the Route Server model
29 @section Description of the Route Server model
31 First we are going to describe the normal processing that BGP announcements
32 suffer inside a standard BGP speaker, as shown in @ref{fig:normal-processing},
33 it consists of three steps:
37 When an announcement is received from some peer, the `In' filters
38 configured for that peer are applied to the announcement. These filters can
39 reject the announcement, accept it unmodified, or accept it with some of its
43 The announcements that pass the `In' filters go into the
44 Best Path Selection process, where they are compared to other
45 announcements referred to the same destination that have been
46 received from different peers (in case such other
47 announcements exist). For each different destination, the announcement
48 which is selected as the best is inserted into the BGP speaker's Loc-RIB.
51 The routes which are inserted in the Loc-RIB are
52 considered for announcement to all the peers (except the one
53 from which the route came). This is done by passing the routes
54 in the Loc-RIB through the `Out' filters corresponding to each
55 peer. These filters can reject the route,
56 accept it unmodified, or accept it with some of its attributes
57 modified. Those routes which are accepted by the `Out' filters
58 of a peer are announced to that peer.
61 @float Figure,fig:normal-processing
62 @center @image{fig-normal-processing,400pt,,Normal announcement processing}
63 @caption{Announcement processing inside a ``normal'' BGP speaker}
66 Of course we want that the routing tables obtained in each of the routers
67 are the same when using the route server than when not. But as a consequence
68 of having a single BGP peering (against the route server), the BGP speakers
69 can no longer distinguish from/to which peer each announce comes/goes.
70 @anchor{filter-delegation}This means that the routers connected to the route
71 server are not able to apply by themselves the same input/output filters
72 as in the full mesh scenario, so they have to delegate those functions to
75 Even more, the ``best path'' selection must be also performed inside
76 the route server on behalf of its clients. The reason is that if, after
77 applying the filters of the announcer and the (potential) receiver, the
78 route server decides to send to some client two or more different
79 announcements referred to the same destination, the client will only
80 retain the last one, considering it as an implicit withdrawal of the
81 previous announcements for the same destination. This is the expected
82 behavior of a BGP speaker as defined in @cite{RFC1771}, and even though
83 there are some proposals of mechanisms that permit multiple paths for
84 the same destination to be sent through a single BGP peering, none are
85 currently supported by most existing BGP implementations.
87 As a consequence a route server must maintain additional information and
88 perform additional tasks for a RS-client that those necessary for common BGP
89 peerings. Essentially a route server must:
91 @anchor{Route Server tasks}
94 Maintain a separated Routing Information Base (Loc-RIB)
95 for each peer configured as RS-client, containing the routes
96 selected as a result of the ``Best Path Selection'' process
97 that is performed on behalf of that RS-client.
100 Whenever it receives an announcement from a RS-client,
101 it must consider it for the Loc-RIBs of the other RS-clients.
103 @anchor{Route-server path filter process}
106 This means that for each of them the route server must pass the
107 announcement through the appropriate `Out' filter of the
111 Then through the appropriate `In' filter of
112 the potential receiver.
115 Only if the announcement is accepted by both filters it will be passed
116 to the ``Best Path Selection'' process.
119 Finally, it might go into the Loc-RIB of the receiver.
123 When we talk about the ``appropriate'' filter, both the announcer and the
124 receiver of the route must be taken into account. Suppose that the route
125 server receives an announcement from client A, and the route server is
126 considering it for the Loc-RIB of client B. The filters that should be
127 applied are the same that would be used in the full mesh scenario, i.e.,
128 first the `Out' filter of router A for announcements going to router B, and
129 then the `In' filter of router B for announcements coming from router A.
131 We call ``Export Policy'' of a RS-client to the set of `Out' filters that
132 the client would use if there was no route server. The same applies for the
133 ``Import Policy'' of a RS-client and the set of `In' filters of the client
134 if there was no route server.
136 It is also common to demand from a route server that it does not
137 modify some BGP attributes (next-hop, as-path and MED) that are usually
138 modified by standard BGP speakers before announcing a route.
140 The announcement processing model implemented by Quagga is shown in
141 @ref{fig:rs-processing}. The figure shows a mixture of RS-clients (B, C and D)
142 with normal BGP peers (A). There are some details that worth additional
147 Announcements coming from a normal BGP peer are also
148 considered for the Loc-RIBs of all the RS-clients. But
149 logically they do not pass through any export policy.
152 Those peers that are configured as RS-clients do not
153 receive any announce from the `Main' Loc-RIB.
156 Apart from import and export policies,
157 `In' and `Out' filters can also be set for RS-clients. `In'
158 filters might be useful when the route server has also normal
159 BGP peers. On the other hand, `Out' filters for RS-clients are
160 probably unnecessary, but we decided not to remove them as
161 they do not hurt anybody (they can always be left empty).
164 @float Figure,fig:rs-processing
165 @center @image{fig-rs-processing,430pt,,Route Server Processing Model}
166 @caption{Announcement processing model implemented by the Route Server}
169 @node Commands for configuring a Route Server
170 @section Commands for configuring a Route Server
172 Now we will describe the commands that have been added to quagga
173 in order to support the route server features.
175 @deffn {Route-Server} {neighbor @var{peer-group} route-server-client} {}
176 @deffnx {Route-Server} {neighbor @var{A.B.C.D} route-server-client} {}
177 @deffnx {Route-Server} {neighbor @var{X:X::X:X} route-server-client} {}
178 This command configures the peer given by @var{peer}, @var{A.B.C.D} or
179 @var{X:X::X:X} as an RS-client.
181 Actually this command is not new, it already existed in standard Quagga. It
182 enables the transparent mode for the specified peer. This means that some
183 BGP attributes (as-path, next-hop and MED) of the routes announced to that
184 peer are not modified.
186 With the route server patch, this command, apart from setting the
187 transparent mode, creates a new Loc-RIB dedicated to the specified peer
188 (those named `Loc-RIB for X' in @ref{fig:rs-processing}.). Starting from
189 that moment, every announcement received by the route server will be also
190 considered for the new Loc-RIB.
193 @deffn {Route-Server} {neigbor @{A.B.C.D|X.X::X.X|peer-group@} route-map WORD @{import|export@}} {}
194 This set of commands can be used to specify the route-map that
195 represents the Import or Export policy of a peer which is
196 configured as a RS-client (with the previous command).
199 @deffn {Route-Server} {match peer @{A.B.C.D|X:X::X:X@}} {}
200 This is a new @emph{match} statement for use in route-maps, enabling them to
201 describe import/export policies. As we said before, an import/export policy
202 represents a set of input/output filters of the RS-client. This statement
203 makes possible that a single route-map represents the full set of filters
204 that a BGP speaker would use for its different peers in a non-RS scenario.
206 The @emph{match peer} statement has different semantics whether it is used
207 inside an import or an export route-map. In the first case the statement
208 matches if the address of the peer who sends the announce is the same that
209 the address specified by @{A.B.C.D|X:X::X:X@}. For export route-maps it
210 matches when @{A.B.C.D|X:X::X:X@} is the address of the RS-Client into whose
211 Loc-RIB the announce is going to be inserted (how the same export policy is
212 applied before different Loc-RIBs is shown in @ref{fig:rs-processing}.).
215 @deffn {Route-map Command} {call @var{WORD}} {}
216 This command (also used inside a route-map) jumps into a different
217 route-map, whose name is specified by @var{WORD}. When the called
218 route-map finishes, depending on its result the original route-map
219 continues or not. Apart from being useful for making import/export
220 route-maps easier to write, this command can also be used inside
221 any normal (in or out) route-map.
224 @node Example of Route Server Configuration
225 @section Example of Route Server Configuration
227 Finally we are going to show how to configure a Quagga daemon to act as a
228 Route Server. For this purpose we are going to present a scenario without
229 route server, and then we will show how to use the configurations of the BGP
230 routers to generate the configuration of the route server.
232 All the configuration files shown in this section have been taken
233 from scenarios which were tested using the VNUML tool
234 @uref{http://www.dit.upm.es/vnuml,VNUML}.
237 * Configuration of the BGP routers without Route Server::
238 * Configuration of the BGP routers with Route Server::
239 * Configuration of the Route Server itself::
240 * Further considerations about Import and Export route-maps::
243 @node Configuration of the BGP routers without Route Server
244 @subsection Configuration of the BGP routers without Route Server
246 We will suppose that our initial scenario is an exchange point with three
247 BGP capable routers, named RA, RB and RC. Each of the BGP speakers generates
248 some routes (with the @var{network} command), and establishes BGP peerings
249 against the other two routers. These peerings have In and Out route-maps
250 configured, named like ``PEER-X-IN'' or ``PEER-X-OUT''. For example the
251 configuration file for router RA could be the following:
255 #Configuration for router 'RA'
261 no bgp default ipv4-unicast
262 neighbor 2001:0DB8::B remote-as 65002
263 neighbor 2001:0DB8::C remote-as 65003
266 network 2001:0DB8:AAAA:1::/64
267 network 2001:0DB8:AAAA:2::/64
268 network 2001:0DB8:0000:1::/64
269 network 2001:0DB8:0000:2::/64
271 neighbor 2001:0DB8::B activate
272 neighbor 2001:0DB8::B soft-reconfiguration inbound
273 neighbor 2001:0DB8::B route-map PEER-B-IN in
274 neighbor 2001:0DB8::B route-map PEER-B-OUT out
276 neighbor 2001:0DB8::C activate
277 neighbor 2001:0DB8::C soft-reconfiguration inbound
278 neighbor 2001:0DB8::C route-map PEER-C-IN in
279 neighbor 2001:0DB8::C route-map PEER-C-OUT out
282 ipv6 prefix-list COMMON-PREFIXES seq 5 permit 2001:0DB8:0000::/48 ge 64 le 64
283 ipv6 prefix-list COMMON-PREFIXES seq 10 deny any
285 ipv6 prefix-list PEER-A-PREFIXES seq 5 permit 2001:0DB8:AAAA::/48 ge 64 le 64
286 ipv6 prefix-list PEER-A-PREFIXES seq 10 deny any
288 ipv6 prefix-list PEER-B-PREFIXES seq 5 permit 2001:0DB8:BBBB::/48 ge 64 le 64
289 ipv6 prefix-list PEER-B-PREFIXES seq 10 deny any
291 ipv6 prefix-list PEER-C-PREFIXES seq 5 permit 2001:0DB8:CCCC::/48 ge 64 le 64
292 ipv6 prefix-list PEER-C-PREFIXES seq 10 deny any
294 route-map PEER-B-IN permit 10
295 match ipv6 address prefix-list COMMON-PREFIXES
297 route-map PEER-B-IN permit 20
298 match ipv6 address prefix-list PEER-B-PREFIXES
299 set community 65001:11111
301 route-map PEER-C-IN permit 10
302 match ipv6 address prefix-list COMMON-PREFIXES
304 route-map PEER-C-IN permit 20
305 match ipv6 address prefix-list PEER-C-PREFIXES
306 set community 65001:22222
308 route-map PEER-B-OUT permit 10
309 match ipv6 address prefix-list PEER-A-PREFIXES
311 route-map PEER-C-OUT permit 10
312 match ipv6 address prefix-list PEER-A-PREFIXES
318 @node Configuration of the BGP routers with Route Server
319 @subsection Configuration of the BGP routers with Route Server
321 To convert the initial scenario into one with route server, first we must
322 modify the configuration of routers RA, RB and RC. Now they must not peer
323 between them, but only with the route server. For example, RA's
324 configuration would turn into:
327 # Configuration for router 'RA'
333 no bgp default ipv4-unicast
334 neighbor 2001:0DB8::FFFF remote-as 65000
337 network 2001:0DB8:AAAA:1::/64
338 network 2001:0DB8:AAAA:2::/64
339 network 2001:0DB8:0000:1::/64
340 network 2001:0DB8:0000:2::/64
342 neighbor 2001:0DB8::FFFF activate
343 neighbor 2001:0DB8::FFFF soft-reconfiguration inbound
350 Which is logically much simpler than its initial configuration, as it now
351 maintains only one BGP peering and all the filters (route-maps) have
354 @node Configuration of the Route Server itself
355 @subsection Configuration of the Route Server itself
357 As we said when we described the functions of a route server
358 (@pxref{Description of the Route Server model}), it is in charge of all the
359 route filtering. To achieve that, the In and Out filters from the RA, RB and
360 RC configurations must be converted into Import and Export policies in the
363 This is a fragment of the route server configuration (we only show
364 the policies for client RA):
367 # Configuration for Route Server ('RS')
372 bgp multiple-instance
374 router bgp 65000 view RS
375 no bgp default ipv4-unicast
376 neighbor 2001:0DB8::A remote-as 65001
377 neighbor 2001:0DB8::B remote-as 65002
378 neighbor 2001:0DB8::C remote-as 65003
381 neighbor 2001:0DB8::A activate
382 neighbor 2001:0DB8::A route-server-client
383 neighbor 2001:0DB8::A route-map RSCLIENT-A-IMPORT import
384 neighbor 2001:0DB8::A route-map RSCLIENT-A-EXPORT export
385 neighbor 2001:0DB8::A soft-reconfiguration inbound
387 neighbor 2001:0DB8::B activate
388 neighbor 2001:0DB8::B route-server-client
389 neighbor 2001:0DB8::B route-map RSCLIENT-B-IMPORT import
390 neighbor 2001:0DB8::B route-map RSCLIENT-B-EXPORT export
391 neighbor 2001:0DB8::B soft-reconfiguration inbound
393 neighbor 2001:0DB8::C activate
394 neighbor 2001:0DB8::C route-server-client
395 neighbor 2001:0DB8::C route-map RSCLIENT-C-IMPORT import
396 neighbor 2001:0DB8::C route-map RSCLIENT-C-EXPORT export
397 neighbor 2001:0DB8::C soft-reconfiguration inbound
400 ipv6 prefix-list COMMON-PREFIXES seq 5 permit 2001:0DB8:0000::/48 ge 64 le 64
401 ipv6 prefix-list COMMON-PREFIXES seq 10 deny any
403 ipv6 prefix-list PEER-A-PREFIXES seq 5 permit 2001:0DB8:AAAA::/48 ge 64 le 64
404 ipv6 prefix-list PEER-A-PREFIXES seq 10 deny any
406 ipv6 prefix-list PEER-B-PREFIXES seq 5 permit 2001:0DB8:BBBB::/48 ge 64 le 64
407 ipv6 prefix-list PEER-B-PREFIXES seq 10 deny any
409 ipv6 prefix-list PEER-C-PREFIXES seq 5 permit 2001:0DB8:CCCC::/48 ge 64 le 64
410 ipv6 prefix-list PEER-C-PREFIXES seq 10 deny any
412 route-map RSCLIENT-A-IMPORT permit 10
413 match peer 2001:0DB8::B
415 route-map RSCLIENT-A-IMPORT permit 20
416 match peer 2001:0DB8::C
419 route-map A-IMPORT-FROM-B permit 10
420 match ipv6 address prefix-list COMMON-PREFIXES
422 route-map A-IMPORT-FROM-B permit 20
423 match ipv6 address prefix-list PEER-B-PREFIXES
424 set community 65001:11111
426 route-map A-IMPORT-FROM-C permit 10
427 match ipv6 address prefix-list COMMON-PREFIXES
429 route-map A-IMPORT-FROM-C permit 20
430 match ipv6 address prefix-list PEER-C-PREFIXES
431 set community 65001:22222
433 route-map RSCLIENT-A-EXPORT permit 10
434 match peer 2001:0DB8::B
435 match ipv6 address prefix-list PEER-A-PREFIXES
436 route-map RSCLIENT-A-EXPORT permit 20
437 match peer 2001:0DB8::C
438 match ipv6 address prefix-list PEER-A-PREFIXES
445 If you compare the initial configuration of RA with the route server
446 configuration above, you can see how easy it is to generate the Import and
447 Export policies for RA from the In and Out route-maps of RA's original
450 When there was no route server, RA maintained two peerings, one with RB and
451 another with RC. Each of this peerings had an In route-map configured. To
452 build the Import route-map for client RA in the route server, simply add
453 route-map entries following this scheme:
456 route-map <NAME> permit 10
457 match peer <Peer Address>
458 call <In Route-Map for this Peer>
459 route-map <NAME> permit 20
460 match peer <Another Peer Address>
461 call <In Route-Map for this Peer>
464 This is exactly the process that has been followed to generate the route-map
465 RSCLIENT-A-IMPORT. The route-maps that are called inside it (A-IMPORT-FROM-B
466 and A-IMPORT-FROM-C) are exactly the same than the In route-maps from the
467 original configuration of RA (PEER-B-IN and PEER-C-IN), only the name is
470 The same could have been done to create the Export policy for RA (route-map
471 RSCLIENT-A-EXPORT), but in this case the original Out route-maps where so
472 simple that we decided not to use the @var{call WORD} commands, and we
473 integrated all in a single route-map (RSCLIENT-A-EXPORT).
475 The Import and Export policies for RB and RC are not shown, but
476 the process would be identical.
478 @node Further considerations about Import and Export route-maps
479 @subsection Further considerations about Import and Export route-maps
481 The current version of the route server patch only allows to specify a
482 route-map for import and export policies, while in a standard BGP speaker
483 apart from route-maps there are other tools for performing input and output
484 filtering (access-lists, community-lists, ...). But this does not represent
485 any limitation, as all kinds of filters can be included in import/export
486 route-maps. For example suppose that in the non-route-server scenario peer
487 RA had the following filters configured for input from peer B:
490 neighbor 2001:0DB8::B prefix-list LIST-1 in
491 neighbor 2001:0DB8::B filter-list LIST-2 in
492 neighbor 2001:0DB8::B route-map PEER-B-IN in
495 route-map PEER-B-IN permit 10
496 match ipv6 address prefix-list COMMON-PREFIXES
497 set local-preference 100
498 route-map PEER-B-IN permit 20
499 match ipv6 address prefix-list PEER-B-PREFIXES
500 set community 65001:11111
503 It is posible to write a single route-map which is equivalent to
504 the three filters (the community-list, the prefix-list and the
505 route-map). That route-map can then be used inside the Import
506 policy in the route server. Lets see how to do it:
509 neighbor 2001:0DB8::A route-map RSCLIENT-A-IMPORT import
513 route-map RSCLIENT-A-IMPORT permit 10
514 match peer 2001:0DB8::B
519 route-map A-IMPORT-FROM-B permit 1
520 match ipv6 address prefix-list LIST-1
523 route-map A-IMPORT-FROM-B deny 2
524 route-map A-IMPORT-FROM-B permit 10
525 match ipv6 address prefix-list COMMON-PREFIXES
526 set local-preference 100
527 route-map A-IMPORT-FROM-B permit 20
528 match ipv6 address prefix-list PEER-B-PREFIXES
529 set community 65001:11111
535 The route-map A-IMPORT-FROM-B is equivalent to the three filters
536 (LIST-1, LIST-2 and PEER-B-IN). The first entry of route-map
537 A-IMPORT-FROM-B (sequence number 1) matches if and only if both
538 the prefix-list LIST-1 and the filter-list LIST-2 match. If that
539 happens, due to the ``on-match goto 10'' statement the next
540 route-map entry to be processed will be number 10, and as of that
541 point route-map A-IMPORT-FROM-B is identical to PEER-B-IN. If
542 the first entry does not match, `on-match goto 10'' will be
543 ignored and the next processed entry will be number 2, which will
546 Thus, the result is the same that with the three original filters,
547 i.e., if either LIST-1 or LIST-2 rejects the route, it does not
548 reach the route-map PEER-B-IN. In case both LIST-1 and LIST-2
549 accept the route, it passes to PEER-B-IN, which can reject, accept