]> git.ipfire.org Git - thirdparty/bird.git/blame - doc/bird.sgml
Tried to write a better introduction.
[thirdparty/bird.git] / doc / bird.sgml
CommitLineData
d37f899b
PM
1<!doctype linuxdoc system>
2
3<!--
d150c637 4 BIRD documentation
d37f899b 5
7581b81b 6 Look for "about this documentation" section to learn more.
d37f899b
PM
7
8 (set-fill-column 100)
9
10 Copyright 1999,2000 Pavel Machek <pavel@ucw.cz>, distribute under GPL version 2 or later.
11
12 -->
13
14<article>
15
d150c637 16<title>BIRD
d37f899b
PM
17<author>
18Pavel Machek <tt/pavel@ucw.cz/
19
20<date>2000
21<abstract>
bfd71178 22This document contains documentation for BIRD Internet Routing Daemon
d37f899b
PM
23</abstract>
24
25<!-- Table of contents -->
26<toc>
27
28<!-- Begin the document -->
29
30<sect>Introduction
31
d150c637 32<sect1>What is BIRD
d37f899b 33
897cd7aa
MM
34<p><label id="intro">
35The name `BIRD' is actually an acronym standing for `BIRD Internet Routing Daemon'.
36Let's take a closer look at the meaning of the name:
37
38<p><em/BIRD/: Well, we think we have already explained that. It's an acronym standing
39for `BIRD Internet Routing Daemon', you remember, don't you? :-)
40
41<p><em/Internet Routing/: It's a program (well, a daemon, as you are going to discover in a moment)
42which works as a dynamic router in an Internet type network (that is, in a network running either
43the IPv4 or the IPv6 protocol). Routers are devices which forward packets between interconnected
44networks in order to allow hosts not connected directly to the same local area network to
45communicate with each other. They also communicate with other routers in the Internet to discover
46the topology of the network which allows them to find optimal (in terms of some metric) rules for
47forwarding of packets (which will be called routes in the rest of this document) and to adapt to the
48changing conditions such as outages of network links, building of new connections and so on. Most of
49these routers are costly dedicated devices running obscure firmware which is hard to configure and
50not open to any changes. Fortunately, most operating systems of the UNIX family allow an ordinary
51computer to act as a router and forward packets belonging to the other hosts, but only according to
52a statically configured table.
53
54<p>A <em/Routing Daemon/ is in UNIX terminology a non-interactive program running on
55background which does the dynamic part of Internet routing, that is it communicates
56with the other routers, calculates routing tables and sends them to the OS kernel
57which does the actual packet forwarding.
58
59<p>There already exist some such routing daemons (routed, GateD <HTMLURL URL="http://www.gated.org/">
60and Zebra <HTMLURL URL="http://www.zebra.org">), but their capabilities are very limited and
61they are very hard to configure and maintain.
62
63<p>BIRD is an Internet Routing Daemon designed to avoid all of these shortcomings,
64to support all the routing technology used in today's Internet or planned to be
65used in near future and to have a clean extensible architecture allowing new routing
66protocols to be incorporated easily. Among other features, BIRD supports:
67
68<itemize>
69 <item>both IPv4 and IPv6 protocols
70 <item>multiple routing tables
71 <item>the Border Gateway Protocol (BGPv4)
72 <item>the Routing Interchange Protocol (RIPv2)
73 <item>the Open Shortest Path First protocol (OSPFv2)
74 <item>a virtual protocol for exchange of routes between internal routing tables
75 <item>a command-line interface allowing on-line control and inspection
76 of status of the daemon
77 <item>soft reconfiguration (no need to use complex online commands
78 to change the configuration, just edit the configuration file
79 and notify BIRD to re-read it and it will smoothly switch
80 to the new configuration, not disturbing routing protocols
81 unless they are affected by the configuration changes)
82 <item>powerful language for route filtering
83</itemize>
84
85<p>BIRD has been developed at the Faculty of Math and Physics, Charles University, Prague,
86Czech Republic as a student project. It's distributed under the terms of the GNU General
87Public License.
88
89<p>BIRD has been designed to work on all UNIX-like systems. It has been developed and
90tested under Linux 2.0 to 2.3, but porting to other systems (even non-UNIX ones) should
91be relatively easy due to its highly modular architecture).
d37f899b
PM
92
93<sect1>About this documentation
94
a0dd1c74 95<p>This documentation can have 4 forms: sgml (this is master copy), html, ASCII text (generated from
0e7a720a
PM
96html) and dvi/postscript (generated from sgml using sgmltools). You should always edit master copy,
97it is slightly modified linuxdoc dtd. Anything in &lt;descrip&gt; tags is considered definition of
7581b81b 98configuration primitives, &lt;cf&gt; is fragment of configuration within normal text, &lt;m&gt; is
0e5373fd 99"meta" information within fragment of configuration -- something in config which is not keyword.
d37f899b 100
d26524fa
PM
101<sect1>About routing tables
102
103<p>Bird has one or more routing tables. Each routing table contains
98627595
PM
104list of known routes. Each route has certain attributes, most
105important is prefix of network this route is for. Routing table
106maintains more than one entry for network, but at most one entry for
107one network and one protocol. The entry with biggest preference is
108used for routing. If there are more entries with same preference and
109they are from same protocol, protocol decides (typically according to
110metrics). You can get list of route attributes in "Route attributes"
d26524fa
PM
111section in filters.
112
af0b25d2
PM
113<sect>Configuration
114
115<sect1>Introduction
d37f899b 116
d150c637
PM
117<p>BIRD is configured using text configuration file. At startup, BIRD reads <file/bird.conf/ (unless
118-c command line parameter is given). Configuration may be changed on user request: if you modify
119config file and then signal BIRD with SIGHUP, it will adjust to new config. There's BIRD client,
1b55b1a3 120which allows you to talk with BIRD in more extensive way than just telling it to reconfigure. BIRD
d150c637
PM
121writes messages about its work to log files or syslog (according to config).
122
4a5bb2bf
PM
123<p>Bird is configured using text configuration file. At startup, bird
124reads <file/bird.conf/ (unless -c command line parameter is
125given). Everything on a line after <cf/#/ is a comment, whitespace is
69477cad
PM
126ignored, C-style comments <cf>/* comment */</cf> are also
127recognized. If there's variable number of options, it is grouped using
4a5bb2bf
PM
128<cf/{ }/ brackets. Each option is terminated by <cf/;/.
129
d150c637 130<p>Really simple configuration file might look like this:
d37f899b 131
a0dd1c74 132<code>
d37f899b 133protocol kernel {
d150c637 134 persist; # Don't remove routes on BIRD shutdown
d37f899b
PM
135 scan time 20; # Scan kernel routing table every 20 seconds
136 export all; # Default is export none
137}
138
139protocol device {
140 scan time 10; # Scan interfaces every 10 seconds
141}
142
143protocol rip {
144 export all;
145 import all;
146}
a0dd1c74 147</code>
d37f899b 148
af0b25d2
PM
149<sect1>Global options
150
a0dd1c74 151<p><descrip>
2f647f3f
PM
152 <tag>log "<m/filename/"|syslog|stderr all|{ <m/list of classes/ }</tag>
153 set logging of classes (either all or <cf/{
242352b7 154 error, trace }/ etc.) into selected destination. Classes are:
98627595
PM
155 <cf/info/, <cf/warning/, <cf/error/, <cf/fatal/ for messages about local problems
156 <cf/debug/ for debugging messages,
157 <cf/trace/ when you want to know what happens on network,
158 <cf/remote/ for messages about misbehavior of remote side,
159 <cf/auth/ about authentication failures,
160 <cf/bug/ for internal bugs
d150c637 161 of BIRD. You may specify more than one <cf/log/ line to log to multiple
7581b81b 162 destinations.
249d238c 163
7581b81b 164 <tag>debug protocols all|off|{ states, routes, filters, interfaces, events, packets }</tag>
d150c637 165 sets global default of protocol debugging options.
249d238c 166
7581b81b
PM
167 <tag>filter <m/name/{ <m/commands/ }</tag> define filter. You can learn more about filters
168 in next chapter.
bfd71178 169
d150c637 170 <tag>protocol rip|ospf|bgp|... <m/[name]/ { <m>protocol options</m> }</tag> define protocol
7581b81b 171 instance, called name (or called something like rip5 if you omit name). You can learn more
d150c637
PM
172 about configuring protocols in their own chapters. You can run more than one instance of
173 most protocols (like rip or bgp).
249d238c 174
7581b81b
PM
175 <tag>define constant = expression</tag> define constant. You can use it later in every place
176 you could use simple integer.
249d238c 177
d150c637
PM
178 <tag>router id <m/IPv4 address/</tag> set router id. Router id needs to be world-wide
179 unique. It is usually one of router's IPv4 addresses.
249d238c 180
0e7a720a 181 <tag>table <m/name/</tag> create new routing table.
af0b25d2 182
0e5373fd 183 <tag>eval <m/expr/</tag> evaluates given filter expression. It is used for testing.
249d238c
PM
184</descrip>
185
d150c637 186<sect1>Protocol options
bfd71178 187
af0b25d2
PM
188<p>Several options are per-protocol, but all protocols support them. They are described here.
189
190<descrip>
d150c637 191 <tag>preference <m/expr/</tag> sets preference of routes generated by this protocol.
7581b81b 192
1b55b1a3 193 <tag>disabled</tag> disables given protocol. You can disable/enable protocol from command
d150c637 194 line interface without needing to touch config.
7581b81b
PM
195
196 <tag>debug <m/setting/</tag> this is similar to global debug setting, except that it only
d150c637
PM
197 affects one protocol. Only messages in selected debugging categories will be written to
198 logs.
7581b81b
PM
199
200 <tag>import <m/filter/</tag> filter can be either either <cf> { <m>filter commands</m>
201 }</cf> or <cf>filter <m/name/</cf>. Import filter works in direction from protocol to main
202 routing table.
bfd71178 203
7581b81b
PM
204 <tag>export <m/filter/</tag> This is similar to <cf>export</cf> keyword, except that it
205 works in direction from main routing table to protocol.
af0b25d2
PM
206
207 <tag>table <m/name/</tag> Connect this protocol to non-default table.
7581b81b
PM
208</descrip>
209
210<p>There are per-protocol options that give sense only with certain protocols.
211
212<descrip>
213 <tag>passwords { password "<m/password/" from <m/time/ to <m/time/ passive <m/time/ id
214 <m/num/ [...] }</tag> specifies passwords to be used with this protocol. Passive time is
215 time from which password is not announced but is allowed. id is password id, as needed by
216 certain protocols.
217
d150c637
PM
218 <tag>interface "<m/mask/"|<m/prefix/ [ { <m/option/ ; [ ... ] } ]</tag> specifies, which
219 interfaces this protocol is active at, and allows you to set options on
220 interface-by-interface basis. Mask is specified in shell-like patters, thus <cf>interface
221 "*" { mode broadcast; };</cf> will start given protocol on all interfaces, with <cf>mode
222 broadcast;</cf> option.
223
7581b81b 224</descrip>
d37f899b
PM
225
226<sect>Filters
227
228<sect1>Introduction
229
d150c637
PM
230<p>BIRD contains rather simple programming language. (No, it can not yet read mail :-). There are
231two objects in this language: filters and functions. Filters are called by BIRD core when route is
d37f899b 232being passed between protocol and main routing table, and filters may call functions. Functions may
0e5373fd 233call other functions, but recursion is not allowed. Filter language contains control structures such
d37f899b 234as if's and switches, but it allows no loops. Filters are
7581b81b 235interpreted. Filter using many features can be found in <file>filter/test.conf</file>.
d37f899b 236
7581b81b
PM
237<p>You can find sources of filters language in <file>filter/</file>
238directory. <file>filter/config.Y</file> contains filter grammar, and basically translates source from
239user into tree of <cf>f_inst</cf> structures. These trees are later interpreted using code in
a0dd1c74
PM
240<file>filter/filter.c</file>. Filters internally work with values/variables in <tt>struct
241f_val</tt>, which contains type of value and value.
d37f899b 242
0e5373fd
PM
243<p>Filter basically gets the route, looks at its attributes and
244modifies some of them if it wishes. At the end, it decides, whether to
245pass change route through (using <cf/accept/), or whether to <cf/reject/ given route. It looks
246like this:
d37f899b 247
a0dd1c74 248<code>
d37f899b
PM
249filter not_too_far
250int var;
251{
252 if defined( rip_metric ) then
253 var = rip_metric;
254 else {
255 var = 1;
256 rip_metric = 1;
257 }
258 if rip_metric &gt; 10 then
259 reject "RIP metric is too big";
260 else
261 accept "ok";
262}
a0dd1c74 263</code>
d37f899b 264
0e5373fd
PM
265<p>As you can see, filter has a header, list of local variables, and body. Header consists of
266<cf/filter/ keyword, followed by (unique) name of filter. List of local variables consists of
0e7a720a 267pairs <cf><M>type name</M>;</cf>, where each pair defines one local variable. Body consists of
7581b81b
PM
268<cf> { <M>statements</M> }</cf>. Statements are terminated by <cf/;/. You can group
269several statements into one by <cf>{ <M>statements</M> }</cf> construction, that is useful if
d37f899b
PM
270you want to make bigger block of code conditional.
271
d150c637
PM
272<p>There are two special filters, <cf/all/ (which accepts all routes) and <cf/none/ (which rejects
273all routes).
274
275
0e5373fd
PM
276<p>Bird supports functions, so that you don't have to repeat same blocks of code over and
277over. Functions can have zero or more parameters, and can have local variables. Function basically
278looks like this:
279
280<code>
281function name ()
282int local_variable;
283{
284 local_variable = 5;
285}
286
287function with_parameters (int parameter)
288{
289 print parameter;
290}
291</code>
292
293<p>Unlike C, variables are declared after function line but before first {. You can not declare
294variables in nested blocks. Functions are called like in C: <cf>name();
295with_parameters(5);</cf>. Function may return value using <cf>return <m/[expr]/</cf>
296syntax. Returning value exits from current function (this is similar to C).
297
298<p>Filters are declared in similar way to functions, except they can not have explicit
299parameters. They get route table entry as implicit parameter. Route table entry is passed implicitly
2f647f3f
PM
300to any functions being called. Filter must terminate with either
301accept or reject statement. If there's runtime error in filter, route
302is rejected.
0e5373fd 303
d37f899b
PM
304<sect1>Data types
305
306<p>Each variable and each value has certain type. Unlike C, filters distinguish between integers and
307booleans (that is to prevent you from shooting in the foot).
308
309<descrip>
7581b81b
PM
310 <tag/bool/ this is boolean type, it can have only two values, <cf/TRUE/ and
311 <cf/FALSE/. Boolean is not compatible with integer and is the only type you can use in if
312 statements.
d37f899b 313
7581b81b
PM
314 <tag/int/ this is common integer, you can expect it to store signed values from -2000000000
315 to +2000000000.
d37f899b 316
7581b81b
PM
317 <tag/pair/ this is pair of two short integers. Each component can have values from 0 to
318 65535. Constant of this type is written as <cf/(1234,5678)/.
d37f899b 319
7581b81b
PM
320 <tag/string/ this is string of characters. There are no ways to modify strings in
321 filters. You can pass them between functions, assign to variable of type string, print
322 such variables, but you can not concatenate two strings (for example). String constants
0e5373fd 323 are written as <cf/"This is a string constant"/.
d37f899b 324
d150c637 325 <tag/ip/ this type can hold single ip address. Depending on version of BIRD you are using, it
7581b81b 326 can be IPv4 or IPv6 address. IPv4 addresses are written (as you would expect) as
0e7a720a
PM
327 <cf/1.2.3.4/. You can apply special operator <cf>.mask(<M>num</M>)</cf>
328 on values of type ip. It masks out all but first <cf><M>num</M></cf> bits from ip
d37f899b
PM
329 address. So <cf/1.2.3.4.mask(8) = 1.0.0.0/ is true.
330
7581b81b 331 <tag/prefix/ this type can hold ip address, prefix len pair. Prefixes are written as
0e5373fd
PM
332 <cf><M>ipaddress</M>/<M>pxlen</M></cf>, or
333 <cf><m>ipaddress</m>/<m>netmask</m></cf> There are two special
334 operators on prefix:
7581b81b
PM
335 <cf/.ip/, which separates ip address from the pair, and <cf/.len/, which separates prefix
336 len from the pair.
d37f899b 337
0e5373fd 338 <tag/int|ip|prefix|pair set/
d37f899b 339 filters know four types of sets. Sets are similar to strings: you can pass them around
52276996 340 but you can not modify them. Constant of type <cf>set int</cf> looks like <cf>
d37f899b
PM
341 [ 1, 2, 5..7 ]</cf>. As you can see, both simple values and ranges are permitted in
342 sets. Sets of prefixes are special: you can specify which prefixes should match them by
52276996 343 using <cf>[ 1.0.0.0/8+, 2.0.0.0/8-, 3.0.0.0/8{5,6} ]</cf>. 3.0.0.0/8{5,6} matches
7581b81b 344 prefixes 3.X.X.X, whose prefix length is 5 to 6. 3.0.0.0/8+ is shorthand for 3.0.0.0/{0,8},
d37f899b
PM
345 3.0.0.0/8- is shorthand for 3.0.0.0/{0,7}.
346
347 <tag/enum/
d150c637 348 enumeration types are halfway-internal in the BIRD. You can not define your own
216fd83c
PM
349 variable of enumeration type, but some predefined variables are of enumeration
350 type. Enumeration types are incompatible with each other, again, for your
d37f899b 351 protection.
0e5373fd
PM
352
353 <tag/bgppath/
4a5bb2bf
PM
354 bgp path is list of autonomous systems.
355
356 <tag/bgpmask/
357 bgp mask is mask used for matching bgp paths
358 (using <cf>path ~ / 2 3 5 ? / syntax </cf>). <cf/?/ is
359 really serving in "any number of autonomous systems", but we
360 did not want to use * because then it becomes too easy to
361 write <cf>/*</cf> which is start of comment.
0e5373fd 362
4a5bb2bf
PM
363 <tag/clist/
364 community list. This is similar to set of pairs,
365 except that unlike other sets, it can be modified.
0e5373fd 366
0e5373fd 367
d37f899b
PM
368</descrip>
369
370<sect1>Operations
371
1b55b1a3 372<p>Filter language supports common integer operations <cf>(+,-,*,/)</cf>, parentheses <cf/(a*(b+c))/, comparison
af0b25d2 373<cf/(a=b, a!=b, a&lt;b, a&gt;=b)/. Special operators include <cf/&tilde;/ for "in" operation. In operation can be
2f647f3f
PM
374used on element and set of that elements, or on ip and prefix, or on
375prefix and prefix or on bgppath and bgpmask or on pair and clist. Its result
0e5373fd
PM
376is true if element is in given set or if ip address is inside given prefix. Operator <cf/=/ is used to assign value
377to variable.
d37f899b
PM
378
379<sect1>Control structures
380
7581b81b
PM
381<p>Filters support two control structures: if/then/else and case. Syntax of if/then/else is <cf>if
382<M>expression</M> then <M>command</M>; else <M>command</M>;</cf> and you can use <cf>{
383<M>command_1</M>; <M>command_2</M>; <M>...</M> }</cf> instead of one or both commands. <cf>else</cf>
384clause may be omitted.
d37f899b 385
7581b81b
PM
386<p><cf>case</cf> is similar to case from Pascal. Syntax is <cf>case <m/expr/ { else |
387<m/num_or_prefix [ .. num_or_prefix]/ : <m/statement/ ; [ ... ] }</cf>. Expression after
af0b25d2 388<cf>case</cf> can be of any type that can be on the left side of &tilde; operator, and anything that could
7581b81b
PM
389be member of set is allowed before :. Multiple commands are allowed without {} grouping. If argument
390matches neither of : clauses, else: clause is used. (Case is actually implemented as set matching,
391internally.)
d37f899b 392
af0b25d2
PM
393<p>Here is example that uses if and case structures:
394
395<code>
396case arg1 {
397 2: print "two"; print "I can do more commands without {}";
398 3 .. 5: print "three to five";
399 else: print "something else";
400 }
401
402if 1234 = i then printn "."; else { print "*** FAIL: if 1 else"; }
403</code>
404
0e5373fd
PM
405<sect1>Route attributes
406
407<p>Filter is implicitly passed route, and it can access its attributes, just like it accesses variables.
408
ba1dda49 409<descrip>
4a5bb2bf 410 <tag>defined( <m>attribute</m> )</tag>
0e5373fd
PM
411 returns TRUE if given attribute is defined. Access to undefined attribute results in runtime error.
412
69477cad 413 <tag/<m/prefix/ network/
0e5373fd
PM
414 network this route is talking about.
415
69477cad 416 <tag/<m/ip/ from/
0e5373fd
PM
417 who told me about this route.
418
69477cad 419 <tag/<m/ip/ gw/
216fd83c 420 what is next hop packets routed using this route should be forwarded to.
0e5373fd 421
69477cad 422 <tag/<m/enum/ source/
0e5373fd 423 what protocol told me about this route. This can have values such as <cf/RTS_RIP/ or <cf/RTS_OSPF_EXT/.
ba1dda49 424</descrip>
0e5373fd
PM
425
426<p>Plus, there are protocol-specific attributes, which are described in protocol sections.
427
69477cad
PM
428<sect1>Utility functions
429
1b55b1a3 430<p>There are few functions you might find convenient to use:
69477cad
PM
431
432<descrip>
433 <tag>print <m/expr/ [ <m/, expr .../ ]</tag>
216fd83c 434 prints given expressions, useful mainly while debugging filters.
69477cad
PM
435
436 <tag>quitbird</tag>
216fd83c 437 terminates bird. Useful while debugging filter interpreter.
69477cad
PM
438</descrip>
439
d37f899b
PM
440<sect>Protocols
441
1b55b1a3
MM
442<sect1>BGP
443
444<sect1>Device
445
79a2b697
MM
446<sect2>Introduction
447
448<p>The Device protocol is not a real routing protocol as it doesn't generate
449any routes and only serves as a module for getting information about network
450interfaces from the kernel.
451
452<p>Except for very unusual circumstances, you probably should always include
453this protocol in the configuration since almost all other protocol don't
454do anything if they are not provided with network interfaces.
455
456<sect2>Configuration
457
458<p><descrip>
459 <tag>scan time <m/number/</tag> Time in seconds between two scans
460 of the network interface list. On systems where we are notified about
461 interface status changes asynchronously (such as newer versions of
462 Linux), we need to scan the list only to avoid confusion by lost
463 notifications, so the default time is set to a large value.
464</descrip>
465
466<sect2>Attributes
467
468<p>As the Device protocol doesn't generate any routes, it cannot have
469any attributes.
470
471<sect2>Example
472
473<p><code>
474protocol device {
475 scan time 10; # Scan the interfaces often
476}
477</code>
478
1b55b1a3
MM
479<sect1>Direct
480
79a2b697
MM
481<sect2>Introduction
482
483<p>The Direct protocol is a simple generator of device routes for all the
484directly connected networks according to the list of interfaces provided
485by the kernel via the Device protocol.
486
487<p>It's highly recommended to include this protocol in your configuration
488unless you want to use BIRD as a route server or a route reflector, that is
489on a machine which doesn't forward packets and only participates in
490distribution of routing information.
491
492<sect2>Configuration
493
494<p><descrip>
495 <tag>interface <m/pattern/, <m/.../</tag> By default, the Direct
496 protocol will generate device routes for all the interfaces
497 available. If you want to restrict it to some subset of interfaces
498 (for example if you're using multiple routing tables for policy
499 routing and some of the policy domains don't contain all interfaces),
500 just use this clause.
501</descrip>
502
503<sect2>Attributes
504
505<p>Direct device routes don't contain any specific attributes.
506
507<sect2>Example
508
509<p><code>
510protocol direct {
511 interface "-arc*", "*"; # Exclude the ARCnets
512}
513</code>
514
1b55b1a3
MM
515<sect1>Kernel
516
517<sect1>OSPF
518
519<sect1>Pipe
520
d37f899b
PM
521<sect1>Rip
522
523<sect2>Introduction
524
525<p>Rip protocol (sometimes called Rest In Pieces) is simple protocol, where each router broadcasts
526distances to all networks he can reach. When router hears distance to other network, it increments
527it and broadcasts it back. Broadcasts are done in regular intervals. Therefore, if some network goes
528unreachable, routers keep telling each other that distance is old distance plus 1 (actually, plus
529interface metric, which is usually one). After some time, distance reaches infinity (that's 15 in
530rip) and all routers know that network is unreachable. Rip tries to minimize situations where
7581b81b 531counting to infinity is necessary, because it is slow. Due to infinity being 16, you can not use
0e7a720a
PM
532rip on networks where maximal distance is bigger than 15 hosts. You can read more about rip at <HTMLURL
533URL="http://www.ietf.org/html.charters/rip-charter.html">.
d37f899b
PM
534
535<sect2>Configuration
536
537<p>In addition to options generic to other protocols, rip supports following options:
538
539<descrip>
7581b81b 540 <tag/authentication none|password|md5/ selects authentication method to use. None means that
0e7a720a 541 packets are not authenticated at all, password means that plaintext password is embedded
7581b81b 542 into each packet, and md5 means that packets are authenticated using md5 cryptographic
0e7a720a
PM
543 hash. If you set authentication to non-none, it is good idea to add <cf>passwords { }</cf>
544 section.
7581b81b
PM
545
546 <tag>honor always|neighbor|never </tag>specifies, when should be routing table updates
547 honored. (Always, when sent from host on directly connected network, or never.)
d37f899b
PM
548</descrip>
549
550<p>There are two options that can be specified per-interface. First is <cf>metric</cf>, with
7581b81b 551default one. Second is <cf>mode multicast|broadcast|quiet|nolisten|version1</cf>, it selects mode for
1b55b1a3 552rip to work in. If nothing is specified, rip runs in multicast mode. <cf>version1</cf> is
d37f899b
PM
553currently equivalent to <cf>broadcast</cf>, and it makes rip talk at broadcast address even
554through multicast mode is possible. <cf>quiet</cf> option means that rip will not transmit
555periodic messages onto this interface and <cf>nolisten</cf> means that rip will talk to this
556interface but not listen on it.
557
9d893489
PM
558<p>Following options generally override specified behavior from RFC. If you use any of these
559options, BIRD will no longer be RFC-compatible, which means it will not be able to talk to anything
d150c637 560other than equally misconfigured BIRD. I warned you.
d37f899b
PM
561
562<descrip>
0e7a720a 563 <tag>port <M>number</M></tag>
d150c637 564 selects IP port to operate on, default 520. (This is useful when testing BIRD, if you
216fd83c 565 set this to address &gt;1024, you will not need to run bird with UID==0).
d37f899b 566
0e7a720a 567 <tag>infinity <M>number</M></tag>
d37f899b
PM
568 select value of infinity, default 16. Bigger values will make protocol convergence
569 even slower.
570
0e7a720a 571 <tag>period <M>number</M>
d37f899b
PM
572 </tag>specifies number of seconds between periodic updates. Default is 30 seconds. Lower
573 number will mean faster convergence but bigger network load.
574
0e7a720a 575 <tag>timeouttime <M>number</M>
d37f899b
PM
576 </tag>specifies how old route has to be to be considered unreachable. Default is 4*period.
577
0e7a720a 578 <tag>garbagetime <M>number</M>
d37f899b
PM
579 </tag>specifies how old route has to be to be discarded. Default is 10*period.
580</descrip>
581
1b55b1a3 582<sect2>Attributes
d37f899b 583
1b55b1a3
MM
584<p>RIP defines two route attributes:
585
586<descrip>
587 <tag>int <cf/rip_metric/</tag> RIP metric of the route (ranging from 0 to <cf/infinity/).
588 When routes from different RIP instances are available and all of them have the same
589 preference, BIRD prefers the route with lowest <cf/rip_metric/.
590
591 <tag>int <cf/rip_tag/</tag> RIP route tag: a 16-bit number which can be used
592 to carry additional information with the route (for example, an originating AS number
593 in case of external routes).
594</descrip>
595
596<sect2>Example
597
598<p><code>
d37f899b
PM
599protocol rip MyRIP_test {
600 debug all;
601 port 1520;
602 period 7;
603 garbagetime 60;
d150c637
PM
604 interface "eth0" { metric 3; mode multicast; } "eth1" { metric 2; mode broadcast; };
605 honor neighbour;
d37f899b
PM
606 passwords { password "ahoj" from 0 to 10;
607 password "nazdar" from 10;
608 }
609 authentication none;
610 import filter { print "importing"; accept; };
611 export filter { print "exporting"; accept; };
612}
a0dd1c74 613</code>
d37f899b 614
1b55b1a3
MM
615<sect1>Static
616
79a2b697
MM
617<sect2>Introduction
618
619<p>The static protocol doesn't communicate with other routers in the network,
620but instead it allows you to define routes manually which is often used for
621specifying how to forward packets to parts of the network which don't use
622dynamic routing at all and also for defining sink routes (i.e., those
623telling to return packets as undeliverable if they are in your IP block,
624you don't have any specific destination for them and you don't want to send
625them out through the default route to prevent routing loops).
626
627<p>There are three types of static routes: `classical' routes telling to
628forward packets to a neighboring router, device routes specifying forwarding
629to hosts on a directly connected network and special routes (sink, blackhole
630etc.) which specify a special action to be done instead of forwarding the
631packet.
632
633<p>When the particular destination is not available (the interface is down or
634the next hop of the route is not a neighbor at the moment), Static just
635uninstalls the route from the table its connected to and adds it again as soon
636as the destinations becomes adjacent again.
637
638<sect2>Configuration
639
640<p>The Static protocol has no configuration options. Instead, the
641definition of the protocol contains a list of static routes which
642can contain:
643
644<descrip>
645 <tag>route <m/prefix/ via <m/ip/</tag> Static route through
646 a neighboring router.
647 <tag>route <m/prefix/ via <m/"interface"/</tag> Static device
648 route through an interface to hosts on a directly connected network.
649 <tag>route <m/prefix/ drop|reject|prohibit</tag> Special routes
650 specifying to drop the packet, return it as unreachable or return
651 it as administratively prohibited.
652</descrip>
653
654<sect2>Attributes
655
656<p>Static routes have no specific attributes.
657
658<sect2>Example
659
660<p><code>
661protocol static {
662 table testable; # Connect to non-default routing table
663 route 0.0.0.0/0 via 62.168.0.13; # Default route
664 route 62.168.0.0/25 reject; # Sink route
665 route 10.2.0.0/24 via "arc0"; # Secondary network
666}
667</code>
668
69477cad
PM
669<sect>Getting more help
670
671<p>This is really last section of this file, should give pointers to
672programmers documentation, web pages mailing lists and similar stuff.
673
674
d37f899b 675</article>
7581b81b 676
69477cad 677
a0dd1c74 678<!--
897cd7aa
MM
679# LocalWords: IPv doctype verb GPL sgml html unix dvi sgmltools linuxdoc dtd descrip config conf syslog stderr auth ospf bgp router's IP expr num inst bool int ip px len enum cf md eval ipaddress pxlen netmask bgppath bgpmask clist gw RTS EXT quitbird nolisten UID timeouttime garbagetime RFC doc
680-->