]> git.ipfire.org Git - thirdparty/bird.git/blobdiff - doc/bird.sgml
BGP: Add option to enforce first AS in AS_PATH
[thirdparty/bird.git] / doc / bird.sgml
index c0999d2db29b81ccbe5690112f4b3e4f6944636f..aeea613fd4107a30eee51dcb26c38e4d111741d0 100644 (file)
@@ -25,7 +25,7 @@ configuration - something in config which is not keyword.
 Ondrej Filip <it/&lt;feela@network.cz&gt;/,
 Pavel Machek <it/&lt;pavel@ucw.cz&gt;/,
 Martin Mares <it/&lt;mj@ucw.cz&gt;/,
-Maria Jan Matejka <it/&lt;mq@jmq.cz&gt;/,
+Maria Matejka <it/&lt;mq@jmq.cz&gt;/,
 Ondrej Zajicek <it/&lt;santiago@crfreenet.org&gt;/
 </author>
 
@@ -403,6 +403,14 @@ configured for all relevant protocols and requires protocol-specific support
 (currently implemented for Kernel and BGP protocols), it is activated for
 particular boot by option <cf/-R/.
 
+<p>Some protocols (e.g. BGP) could be restarted gracefully after both
+intentional outage and crash, while others (e.g. OSPF) after intentional outage
+only. For planned graceful restart, BIRD must be shut down by
+<ref id="cli-graceful-restart" name="graceful restart"> command instead of
+regular <ref id="cli-down" name="down"> command. In this way routing neighbors
+are notified about planned graceful restart and routes are kept in kernel table
+after shutdown.
+
 
 <chapt>Configuration
 <label id="config">
@@ -422,11 +430,11 @@ a comment, whitespace characters are treated as a single space. If there's a
 variable number of options, they are grouped using the <cf/{ }/ brackets. Each
 option is terminated by a <cf/;/. Configuration is case sensitive. There are two
 ways how to name symbols (like protocol names, filter names, constants etc.).
-You can either use a simple string starting with a letter followed by any
-combination of letters and numbers (e.g. <cf/R123/, <cf/myfilter/, <cf/bgp5/) or
-you can enclose the name into apostrophes (<cf/'/) and than you can use any
-combination of numbers, letters. hyphens, dots and colons (e.g.
-<cf/'1:strange-name'/, <cf/'-NAME-'/, <cf/'cool::name'/).
+You can either use a simple string starting with a letter (or underscore)
+followed by any combination of letters, numbers and underscores (e.g. <cf/R123/,
+<cf/my_filter/, <cf/bgp5/) or you can enclose the name into apostrophes (<cf/'/)
+and than you can use any combination of numbers, letters, underscores, hyphens,
+dots and colons (e.g.  <cf/'1:strange-name'/, <cf/'-NAME-'/, <cf/'cool::name'/).
 
 <p>Here is an example of a simple config file. It enables synchronization of
 routing tables with OS kernel, learns network interfaces and runs RIP on all
@@ -471,17 +479,25 @@ ipv6 table
 include "tablename.conf";;
 </code>
 
-       <tag><label id="opt-log">log "<m/filename/"|syslog [name <m/name/]|stderr all|{ <m/list of classes/ }</tag>
-       Set logging of messages having the given class (either <cf/all/ or
-       <cf/{ error|trace [, <m/.../] }/ etc.) into selected destination (a file specified
-       as a filename string, syslog with optional name argument, or the stderr
-       output). Classes are:
+       <tag><label id="opt-log">log "<m/filename/" [<m/limit/ "<m/backup/"] | syslog [name <m/name/] | stderr all|{ <m/list of classes/ }</tag>
+       Set logging of messages having the given class (either <cf/all/ or <cf>{
+       error|trace [, <m/.../] }</cf> etc.) into selected destination - a file
+       specified as a filename string (with optional log rotation information),
+       syslog (with optional name argument), or the stderr output.
+
+       Classes are:
        <cf/info/, <cf/warning/, <cf/error/ and <cf/fatal/ for messages about local problems,
        <cf/debug/ for debugging messages,
        <cf/trace/ when you want to know what happens in the network,
        <cf/remote/ for messages about misbehavior of remote machines,
        <cf/auth/ about authentication failures,
        <cf/bug/ for internal BIRD bugs.
+
+       Logging directly to file supports basic log rotation -- there is an
+       optional log file limit and a backup filename, when log file reaches the
+       limit, the current log file is renamed to the backup filename and a new
+       log file is created.
+
        You may specify more than one <cf/log/ line to establish logging to
        multiple destinations. Default: log everything to the system log, or
        to the debug output if debugging is enabled by <cf/-d//<cf/-D/
@@ -553,8 +569,8 @@ include "tablename.conf";;
        can be seen (together with other symbols) using 'show symbols' command.
 
        <tag><label id="opt-attribute">attribute <m/type/ <m/name/</tag>
-       Define a custom route attribute. You can set and get it in filters like
-       any other route atribute. This feature is intended for marking routes
+       Declare a custom route attribute. You can set and get it in filters like
+       any other route attribute. This feature is intended for marking routes
        in import filters for export filtering purposes instead of locally
        assigned BGP communities which have to be deleted in export filters.
 
@@ -663,14 +679,24 @@ agreement").
        This is an optional description of the protocol. It is displayed as a
        part of the output of 'show protocols all' command.
 
-       <tag><label id="proto-vrf">vrf "<m/text/"</tag>
+       <tag><label id="proto-vrf">vrf "<m/text/"|default</tag>
        Associate the protocol with specific VRF. The protocol will be
        restricted to interfaces assigned to the VRF and will use sockets bound
-       to the VRF. Appropriate VRF interface must exist on OS level. For kernel
-       protocol, an appropriate table still must be explicitly selected by
-       <cf/table/ option. Note that for proper VRF support it is necessary to
-       use Linux kernel version at least 4.14, older versions have limited VRF
-       implementation.
+       to the VRF. A corresponding VRF interface must exist on OS level. For
+       kernel protocol, an appropriate table still must be explicitly selected
+       by <cf/table/ option.
+
+       By selecting <cf/default/, the protocol is associated with the default
+       VRF; i.e., it will be restricted to interfaces not assigned to any
+       regular VRF. That is different from not specifying <cf/vrf/ at all, in
+       which case the protocol may use any interface regardless of its VRF
+       status.
+
+       Note that for proper VRF support it is necessary to use Linux kernel
+       version at least 4.14, older versions have limited VRF implementation.
+       Before Linux kernel 5.0, a socket bound to a port in default VRF collide
+       with others in regular VRFs. In BGP, this can be avoided by using
+       <ref id="bgp-strict-bind" name="strict bind"> option.
 
        <tag><label id="proto-channel"><m/channel name/ [{<m/channel config/}]</tag>
        Every channel must be explicitly stated. See the protocol-specific
@@ -722,10 +748,6 @@ agreement").
        on all interfaces that have address from 192.168.0.0/16, but not from
        192.168.1.0/24.
 
-       <cf>interface -192.168.1.0/24, 192.168.0.0/16;</cf> - start the protocol
-       on all interfaces that have address from 192.168.0.0/16, but not from
-       192.168.1.0/24.
-
        <cf>interface "eth*" 192.168.1.0/24;</cf> - start the protocol on all
        ethernet interfaces that have address from 192.168.1.0/24.
 
@@ -1098,6 +1120,10 @@ This argument can be omitted if there exists only a single instance.
        <tag><label id="cli-down">down</tag>
        Shut BIRD down.
 
+       <tag><label id="cli-graceful-restart">graceful restart</tag>
+       Shut BIRD down for graceful restart. See <ref id="graceful-restart"
+       name="graceful restart"> section for details.
+
        <tag><label id="cli-debug">debug <m/protocol/|<m/pattern/|all all|off|{ states|routes|filters|events|packets [, <m/.../] }</tag>
        Control protocol debugging.
 
@@ -1151,7 +1177,7 @@ int var;
 <p>As you can see, a filter has a header, a list of local variables, and a body.
 The header consists of the <cf/filter/ keyword followed by a (unique) name of
 filter. The list of local variables consists of <cf><M>type name</M>;</cf>
-pairs where each pair defines one local variable. The body consists of <cf>
+pairs where each pair declares one local variable. The body consists of <cf>
 { <M>statements</M> }</cf>. Each <m/statement/ is terminated by a <cf/;/. You
 can group several statements to a single compound statement by using braces
 (<cf>{ <M>statements</M> }</cf>) which is useful if you want to make a bigger
@@ -1180,7 +1206,7 @@ called like in C: <cf>name(); with_parameters(5);</cf>. Function may return
 values using the <cf>return <m/[expr]/</cf> command. Returning a value exits
 from current function (this is similar to C).
 
-<p>Filters are declared in a way similar to functions except they can't have
+<p>Filters are defined in a way similar to functions except they can't have
 explicit parameters. They get a route table entry as an implicit parameter, it
 is also passed automatically to any functions called. The filter must terminate
 with either <cf/accept/ or <cf/reject/ statement. If there's a runtime error in
@@ -1208,8 +1234,8 @@ bird>
 <label id="data-types">
 
 <p>Each variable and each value has certain type. Booleans, integers and enums
-are incompatible with each other (that is to prevent you from shooting in the
-foot).
+are incompatible with each other (that is to prevent you from shooting oneself
+in the foot).
 
 <descrip>
        <tag><label id="type-bool">bool</tag>
@@ -1246,7 +1272,7 @@ foot).
        This type can hold a single IP address. The IPv4 addresses are stored as
        IPv4-Mapped IPv6 addresses so one data type for both of them is used.
        Whether the address is IPv4 or not may be checked by <cf>.is_ip4</cf>
-       which returns <cf/bool/. IP addresses are written in the standard
+       which returns <cf/bool/. IP addresses are written in the standard
        notation (<cf/10.20.30.40/ or <cf/fec0:3:4::1/). You can apply special
        operator <cf>.mask(<M>num</M>)</cf> on values of type ip. It masks out
        all but first <cf><M>num</M></cf> bits from the IP address. So
@@ -1443,7 +1469,8 @@ foot).
        but <tt>bgp_path &tilde; [= * 4 5 * =]</tt> is false. BGP mask
        expressions can also contain integer expressions enclosed in parenthesis
        and integer variables, for example <tt>[= * 4 (1+2) a =]</tt>. You can
-        also use ranges, for example <tt>[= * 3..5 2 100..200 * =]</tt>.
+       also use ranges (e.g. <tt>[= * 3..5 2 100..200 * =]</tt>) and sets
+       (e.g. <tt>[= 1 2 [3, 5, 7] * =]</tt>).
 
        <tag><label id="type-clist">clist</tag>
        Clist is similar to a set, except that unlike other sets, it can be
@@ -1483,7 +1510,7 @@ foot).
        <cf/!&tilde;/ membership operators) can be used to modify or test
        eclists, with ECs instead of pairs as arguments.
 
-       <tag><label id="type-lclist">lclist/</tag>
+       <tag><label id="type-lclist">lclist</tag>
        Lclist is a data type used for BGP large community lists. Like eclists,
        lclists are very similar to clists, but they are sets of LCs instead of
        pairs. The same operations (like <cf/add/, <cf/delete/ or <cf/&tilde;/
@@ -1515,8 +1542,8 @@ the clist that is also a member of the pair/quad set).
 <p>There is one operator related to ROA infrastructure - <cf/roa_check()/. It
 examines a ROA table and does <rfc id="6483"> route origin validation for a
 given network prefix. The basic usage is <cf>roa_check(<m/table/)</cf>, which
-checks current route (which should be from BGP to have AS_PATH argument) in the
-specified ROA table and returns ROA_UNKNOWN if there is no relevant ROA,
+checks the current route (which should be from BGP to have AS_PATH argument) in
+the specified ROA table and returns ROA_UNKNOWN if there is no relevant ROA,
 ROA_VALID if there is a matching ROA, or ROA_INVALID if there are some relevant
 ROAs but none of them match. There is also an extended variant
 <cf>roa_check(<m/table/, <m/prefix/, <m/asn/)</cf>, which allows to specify a
@@ -1563,11 +1590,20 @@ if 1234 = i then printn "."; else {
 <label id="route-attributes">
 
 <p>A filter is implicitly passed a route, and it can access its attributes just
-like it accesses variables. Attempts to access undefined attribute result in a
-runtime error; you can check if an attribute is defined by using the
-<cf>defined( <m>attribute</m> )</cf> operator. One notable exception to this
-rule are attributes of bgppath and *clist types, where undefined value is
-regarded as empty bgppath/*clist for most purposes.
+like it accesses variables. There are common route attributes, protocol-specific
+route attributes and custom route attributes. Most common attributes are
+mandatory (always defined), while remaining are optional.  Attempts to access
+undefined attribute result in a runtime error; you can check if an attribute is
+defined by using the <cf>defined( <m>attribute</m> )</cf> operator. One notable
+exception to this rule are attributes of bgppath and *clist types, where
+undefined value is regarded as empty bgppath/*clist for most purposes.
+
+Attributes can be defined by just setting them in filters. Custom attributes
+have to be first declared by <ref id="opt-attribute" name="attribute"> global
+option. You can also undefine optional attribute back to non-existence by using
+the <cf>unset( <m/attribute/ )</cf> operator.
+
+Common route attributes are:
 
 <descrip>
        <tag><label id="rta-net"><m/prefix/ net</tag>
@@ -1634,8 +1670,8 @@ regarded as empty bgppath/*clist for most purposes.
        compare internal distances to boundary routers (see below).
 </descrip>
 
-<p>There also exist protocol-specific attributes which are described in the
-corresponding protocol sections.
+<p>Protocol-specific route attributes are described in the corresponding
+protocol sections.
 
 
 <sect>Other statements
@@ -1645,7 +1681,7 @@ corresponding protocol sections.
 
 <descrip>
        <tag><label id="assignment"><m/variable/ = <m/expr/</tag>
-       Set variable to a given value.
+       Set variable (or route attribute) to a given value.
 
        <tag><label id="filter-accept-reject">accept|reject [ <m/expr/ ]</tag>
        Accept or reject the route, possibly printing <cf><m>expr</m></cf>.
@@ -1879,12 +1915,11 @@ the BFD session went down).
 advanced features like the echo mode or authentication are not implemented), IP
 transport for BFD as defined in <rfc id="5881"> and <rfc id="5883"> and
 interaction with client protocols as defined in <rfc id="5882">.
-We currently support at most one protocol instance.
 
 <p>BFD packets are sent with a dynamic source port number. Linux systems use by
 default a bit different dynamic port range than the IANA approved one
 (49152-65535). If you experience problems with compatibility, please adjust
-<cf>/proc/sys/net/ipv4/ip_local_port_range</cf>
+<cf>/proc/sys/net/ipv4/ip_local_port_range</cf>.
 
 <sect1>Configuration
 <label id="bfd-config">
@@ -1901,6 +1936,14 @@ configuration is often sufficient.
 <p>Note that to use BFD for other protocols like OSPF or BGP, these protocols
 also have to be configured to request BFD sessions, usually by <cf/bfd/ option.
 
+<p>A BFD instance not associated with any VRF handles session requests from all
+other protocols, even ones associated with a VRF. Such setup would work for
+single-hop BFD sessions if <cf/net.ipv4.udp_l3mdev_accept/ sysctl is enabled,
+but does not currently work for multihop sessions. Another approach is to
+configure multiple BFD instances, one for each VRF (including the default VRF).
+Each BFD instance associated with a VRF (regular or default) only handles
+session requests from protocols in the same VRF.
+
 <p>Some of BFD session options require <m/time/ value, which has to be specified
 with the appropriate unit: <m/num/ <cf/s/|<cf/ms/|<cf/us/. Although microseconds
 are allowed as units, practical minimum values are usually in order of tens of
@@ -2118,6 +2161,7 @@ avoid routing loops.
 <item> <rfc id="6286"> - AS-Wide Unique BGP Identifier
 <item> <rfc id="6608"> - Subcodes for BGP Finite State Machine Error
 <item> <rfc id="6793"> - BGP Support for 4-Octet AS Numbers
+<item> <rfc id="7311"> - Accumulated IGP Metric Attribute for BGP
 <item> <rfc id="7313"> - Enhanced Route Refresh Capability for BGP
 <item> <rfc id="7606"> - Revised Error Handling for BGP UPDATE Messages
 <item> <rfc id="7911"> - Advertisement of Multiple Paths in BGP
@@ -2178,12 +2222,23 @@ using the following configuration parameters:
        <cf/local 10.0.0.1; local as 65000;/ are valid). This parameter is
        mandatory.
 
-       <tag><label id="bgp-neighbor">neighbor [<m/ip/] [port <m/number/] [as <m/number/]</tag>
+       <tag><label id="bgp-neighbor">neighbor [<m/ip/ | range <m/prefix/] [port <m/number/] [as <m/number/] [internal|external]</tag>
        Define neighboring router this instance will be talking to and what AS
        it is located in. In case the neighbor is in the same AS as we are, we
-       automatically switch to iBGP. Optionally, the remote port may also be
-       specified. Like <cf/local/ parameter, this parameter may also be used
-       multiple times with different sub-options. This parameter is mandatory.
+       automatically switch to IBGP. Alternatively, it is possible to specify
+       just <cf/internal/ or <cf/external/ instead of AS number, in that case
+       either local AS number, or any external AS number is accepted.
+       Optionally, the remote port may also be specified. Like <cf/local/
+       parameter, this parameter may also be used multiple times with different
+       sub-options. This parameter is mandatory.
+
+       It is possible to specify network prefix (with <cf/range/ keyword)
+       instead of explicit neighbor IP address. This enables dynamic BGP
+       behavior, where the BGP instance listens on BGP port, but new BGP
+       instances are spawned for incoming BGP connections (if source address
+       matches the network prefix). It is possible to mix regular BGP instances
+       with dynamic BGP instances and have multiple dynamic BGP instances with
+       different ranges.
 
        <tag><label id="bgp-iface">interface <m/string/</tag>
        Define interface we should use for link-local BGP IPv6 sessions.
@@ -2212,9 +2267,19 @@ using the following configuration parameters:
        the number of hops is 2. Default: enabled for iBGP.
 
        <tag><label id="bgp-source-address">source address <m/ip/</tag>
-       Define local address we should use for next hop calculation and as a
-       source address for the BGP session. Default: the address of the local
-       end of the interface our neighbor is connected to.
+       Define local address we should use as a source address for the BGP
+       session. Default: the address of the local end of the interface our
+       neighbor is connected to.
+
+       <tag><label id="bgp-dynamic-name">dynamic name "<m/text/"</tag>
+       Define common prefix of names used for new BGP instances spawned when
+       dynamic BGP behavior is active. Actual names also contain numeric
+       index to distinguish individual instances.  Default: "dynbgp".
+
+       <tag><label id="bgp-dynamic-name-digits">dynamic name digits <m/number/</tag>
+       Define minimum number of digits for index in names of spawned dynamic
+       BGP instances. E.g., if set to 2, then the first name would be
+       "dynbgp01". Default: 0.
 
        <tag><label id="bgp-strict-bind">strict bind <m/switch/</tag>
        Specify whether BGP listening socket should be bound to a specific local
@@ -2330,6 +2395,25 @@ using the following configuration parameters:
        completely disabled and you should ensure loop-free behavior by some
        other means. Default: 0 (no local AS number allowed).
 
+       <tag><label id="bgp-allow-as-sets">allow as sets [<m/switch/]</tag>
+       AS path attribute received with BGP routes may contain not only
+       sequences of AS numbers, but also sets of AS numbers. These rarely used
+       artifacts are results of inter-AS route aggregation. AS sets are
+       deprecated (<rfc id="6472">), and likely to be rejected in the future,
+       as they complicate security features like RPKI validation. When this
+       option is disabled, then received AS paths with AS sets are rejected as
+       malformed and corresponding BGP updates are treated as withdraws.
+       Default: on.
+
+       <tag><label id="bgp-enforce-first-as">enforce first as [<m/switch/]</tag>
+       Routes received from an EBGP neighbor are generally expected to have the
+       first (leftmost) AS number in their AS path equal to the neighbor AS
+       number. This is not enforced by default as there are legitimate cases
+       where it is not true, e.g. connections to route servers. When this
+       option is enabled, routes with non-matching first AS number are rejected
+       and corresponding updates are treated as withdraws. The option is valid
+       on EBGP sessions only. Default: off.
+
        <tag><label id="bgp-enable-route-refresh">enable route refresh <m/switch/</tag>
        After the initial route exchange, BGP protocol uses incremental updates
        to keep BGP speakers synchronized. Sometimes (e.g., if BGP speaker
@@ -2404,8 +2488,8 @@ using the following configuration parameters:
 
        <tag><label id="bgp-enable-extended-messages">enable extended messages <m/switch/</tag>
        The BGP protocol uses maximum message length of 4096 bytes. This option
-       provides an extension to allow extended messages with length up
-       to 65535 bytes. Default: off.
+       provides an extension (<rfc id="8654">) to allow extended messages with
+       length up to 65535 bytes. Default: off.
 
        <tag><label id="bgp-capabilities">capabilities <m/switch/</tag>
        Use capability advertisement to advertise optional capabilities. This is
@@ -2557,19 +2641,38 @@ be used in explicit configuration.
 <p>BGP channels have additional config options (together with the common ones):
 
 <descrip>
-       <tag><label id="bgp-next-hop-keep">next hop keep</tag>
-       Forward the received Next Hop attribute even in situations where the
-       local address should be used instead, like when the route is sent to an
-       interface with a different subnet. Default: disabled.
-
-       <tag><label id="bgp-next-hop-self">next hop self</tag>
-       Avoid calculation of the Next Hop attribute and always advertise our own
-       source address as a next hop. This needs to be used only occasionally to
-       circumvent misconfigurations of other routers. Default: disabled.
+       <tag><label id="bgp-mandatory">mandatory <m/switch/</tag>
+       When local and neighbor sets of configured AFI/SAFI pairs differ,
+       capability negotiation ensures that a common subset is used. For
+       mandatory channels their associated AFI/SAFI must be negotiated
+       (i.e., also announced by the neighbor), otherwise BGP session
+       negotiation fails with <it/'Required capability missing'/ error.
+       Regardless, at least one AFI/SAFI must be negotiated in order to BGP
+       session be successfully established. Default: off.
+
+       <tag><label id="bgp-next-hop-keep">next hop keep <m/switch/|ibgp|ebgp</tag>
+       Do not modify the Next Hop attribute and advertise the current one
+       unchanged even in cases where our own local address should be used
+       instead. This is necessary when the BGP speaker does not forward network
+       traffic (route servers and some route reflectors) and also can be useful
+       in some other cases (e.g. multihop EBGP sessions). Can be enabled for
+       all routes, or just for routes received from IBGP / EBGP neighbors.
+       Default: disabled for regular BGP, enabled for route servers,
+       <cf/ibgp/ for route reflectors.
+
+       <tag><label id="bgp-next-hop-self">next hop self <m/switch/|ibgp|ebgp</tag>
+       Always advertise our own local address as a next hop, even in cases
+       where the current Next Hop attribute should be used unchanged. This is
+       sometimes used for routes propagated from EBGP to IBGP when IGP routing
+       does not cover inter-AS links, therefore IP addreses of EBGP neighbors
+       are not resolvable through IGP. Can be enabled for all routes, or just
+       for routes received from IBGP / EBGP neighbors. Default: disabled.
 
        <tag><label id="bgp-next-hop-address">next hop address <m/ip/</tag>
-       Avoid calculation of the Next Hop attribute and always advertise this address
-       as a next hop.
+       Specify which address to use when our own local address should be
+       announced in the Next Hop attribute. Default: the source address of the
+       BGP session (if acceptable), or the preferred address of an associated
+       interface.
 
        <tag><label id="bgp-missing-lladdr">missing lladdr self|drop|ignore</tag>
        Next Hop attribute in BGP-IPv6 sometimes contains just the global IPv6
@@ -2610,7 +2713,7 @@ be used in explicit configuration.
        the channel is connected to (if eligible).
 
        <tag><label id="bgp-import-table">import table <m/switch/</tag>
-       A BGP import table contain all received routes from given BGP neighbor,
+       A BGP import table contains all received routes from given BGP neighbor,
        before application of import filters. It is also called <em/Adj-RIB-In/
        in BGP terminology. BIRD BGP by default operates without import tables,
        in which case received routes are just processed by import filters,
@@ -2619,6 +2722,16 @@ be used in explicit configuration.
        be examined later by <cf/show route/, and can be used to reconfigure
        import filters without full route refresh. Default: off.
 
+       <tag><label id="bgp-export-table">export table <m/switch/</tag>
+       A BGP export table contains all routes sent to given BGP neighbor, after
+       application of export filters. It is also called <em/Adj-RIB-Out/ in BGP
+       terminology. BIRD BGP by default operates without export tables, in
+       which case routes from master table are just processed by export filters
+       and then announced by BGP. Enabling <cf/export table/ allows to store
+       routes after export filter processing, so they can be examined later by
+       <cf/show route/, and can be used to eliminate unnecessary updates or
+       withdraws. Default: off.
+
        <tag><label id="bgp-secondary">secondary <m/switch/</tag>
        Usually, if an export filter rejects a selected route, no other route is
        propagated for that network. This option allows to try the next route in
@@ -2646,6 +2759,36 @@ be used in explicit configuration.
        TX direction. When active, all available routes accepted by the export
        filter are advertised to the neighbor. Default: off.
 
+       <tag><label id="bgp-aigp">aigp <m/switch/|originate</tag>
+       The BGP protocol does not use a common metric like other routing
+       protocols, instead it uses a set of criteria for route selection
+       consisting both overall AS path length and a distance to the nearest AS
+       boundary router. Assuming that metrics of different autonomous systems
+       are incomparable, once a route is propagated from an AS to a next one,
+       the distance in the old AS does not matter.
+
+       The AIGP extension (<rfc id="7311">) allows to propagate accumulated
+       IGP metric (in the AIGP attribute) through both IBGP and EBGP links,
+       computing total distance through multiple autonomous systems (assuming
+       they use comparable IGP metric). The total AIGP metric is compared in
+       the route selection process just after Local Preference comparison (and
+       before AS path length comparison).
+
+       This option controls whether AIGP attribute propagation is allowed on
+       the session. Optionally, it can be set to <cf/originate/, which not only
+       allows AIGP attribute propagation, but also new AIGP attributes are
+       automatically attached to non-BGP routes with valid IGP metric (e.g.
+       <cf/ospf_metric1/) as they are exported to the BGP session. Default:
+       enabled for IBGP (and intra-confederation EBGP), disabled for regular
+       EBGP.
+
+       <tag><label id="bgp-cost">cost <m/number/</tag>
+       When BGP <ref id="bgp-gateway" name="gateway mode"> is <cf/recursive/
+       (mainly multihop IBGP sessions), then the distance to BGP next hop is
+       based on underlying IGP metric. This option specifies the distance to
+       BGP next hop for BGP sessions in direct gateway mode (mainly direct
+       EBGP sessions).
+
        <tag><label id="bgp-graceful-restart-c">graceful restart <m/switch/</tag>
        Although BGP graceful restart is configured mainly by protocol-wide
        <ref id="bgp-graceful-restart" name="options">, it is possible to
@@ -2714,9 +2857,11 @@ some of them (marked with `<tt/O/') are optional.
        presence of which indicates that the route has been aggregated from
        multiple routes by some router on the path from the originator.
 
-<!-- we don't handle aggregators right since they are of a very obscure type
-       <tag>bgp_aggregator</tag>
--->
+       <tag><label id="rta-bgp-aggregator">void bgp_aggregator [O]</tag>
+       This is an optional attribute specifying AS number and IP address of the
+       BGP router that created the route by aggregating multiple BGP routes.
+       Currently, the attribute is not accessible from filters.
+
        <tag><label id="rta-bgp-community">clist bgp_community [O]</tag>
        List of community values associated with the route. Each such value is a
        pair (represented as a <cf/pair/ data type inside the filters) of 16-bit
@@ -2751,6 +2896,11 @@ some of them (marked with `<tt/O/') are optional.
        <tag><label id="rta-bgp-cluster-list">clist bgp_cluster_list [I, O]</tag>
        This attribute contains a list of cluster IDs of route reflectors. Each
        route reflector prepends its cluster ID when reflecting the route.
+
+       <tag><label id="rta-bgp-aigp">void bgp_aigp [O]</tag>
+       This attribute contains accumulated IGP metric, which is a total
+       distance to the destination through multiple autonomous systems.
+       Currently, the attribute is not accessible from filters.
 </descrip>
 
 <sect1>Example
@@ -3212,6 +3362,8 @@ protocol ospf [v2|v3] &lt;name&gt; {
        tick &lt;num&gt;;
        ecmp &lt;switch&gt; [limit &lt;num&gt;];
        merge external &lt;switch&gt;;
+       graceful restart &lt;switch&gt;|aware;
+       graceful restart time &lt;num&gt;;
        area &lt;id&gt; {
                stub;
                nssa;
@@ -3355,6 +3507,31 @@ protocol ospf [v2|v3] &lt;name&gt; {
        from different LSAs are treated as separate even if they represents the
        same destination. Default value is no.
 
+       <tag><label id="ospf-graceful-restart">graceful restart <m/switch/|aware</tag>
+       When an OSPF instance is restarted, neighbors break adjacencies and
+       recalculate their routing tables, which disrupts packet forwarding even
+       when the forwarding plane of the restarting router remains intact.
+       <rfc id="3623"> specifies a graceful restart mechanism to alleviate this
+       issue. For OSPF graceful restart, restarting router originates
+       Grace-LSAs, announcing intent to do graceful restart. Neighbors
+       receiving these LSAs enter helper mode, in which they ignore breakdown
+       of adjacencies, behave as if nothing is happening and keep old routes.
+       When adjacencies are reestablished, the restarting router flushes
+       Grace-LSAs and graceful restart is ended.
+
+       This option controls the graceful restart mechanism. It has three
+       states: Disabled, when no support is provided. Aware, when graceful
+       restart helper mode is supported, but no local graceful restart is
+       allowed (i.e. helper-only role). Enabled, when the full graceful restart
+       support is provided (i.e. both restarting and helper role). Note that
+       proper support for local graceful restart requires also configuration of
+       other protocols. Default: aware.
+
+       <tag><label id="ospf-graceful-restart-time">graceful restart time <m/num/</tag>
+       The restart time is announced in the Grace-LSA and specifies how long
+       neighbors should wait for proper end of the graceful restart before
+       exiting helper mode prematurely. Default: 120 seconds.
+
        <tag><label id="ospf-area">area <M>id</M></tag>
        This defines an OSPF area with given area ID (an integer or an IPv4
        address, similarly to a router ID). The most important area is the
@@ -3473,6 +3650,11 @@ protocol ospf [v2|v3] &lt;name&gt; {
        Specifies interval in seconds between retransmissions of unacknowledged
        updates. Default value is 5.
 
+       <tag><label id="ospf-transmit-delay">transmit delay <M>num</M></tag>
+       Specifies estimated transmission delay of link state updates send over
+       the interface. The value is added to LSA age of LSAs propagated through
+       it. Default value is 1.
+
        <tag><label id="ospf-priority">priority <M>num</M></tag>
        On every multiple access network (e.g., the Ethernet) Designated Router
        and Backup Designated router are elected. These routers have some special
@@ -3493,16 +3675,6 @@ protocol ospf [v2|v3] &lt;name&gt; {
        <m/dead/ seconds, it will consider the neighbor down. If both directives
        <cf/dead count/ and <cf/dead/ are used, <cf/dead/ has precedence.
 
-       <tag><label id="ospf-secondary">secondary <M>switch</M></tag>
-       On BSD systems, older versions of BIRD supported OSPFv2 only for the
-       primary IP address of an interface, other IP ranges on the interface
-       were handled as stub networks. Since v1.4.1, regular operation on
-       secondary IP addresses is supported, but disabled by default for
-       compatibility. This option allows to enable it. The option is a
-       transitional measure, will be removed in the next major release as the
-       behavior will be changed. On Linux systems, the option is irrelevant, as
-       operation on non-primary addresses is already the regular behavior.
-
        <tag><label id="ospf-rx-buffer">rx buffer <M>num</M></tag>
        This option allows to specify the size of buffers used for packet
        processing. The buffer size should be bigger than maximal size of any
@@ -3741,6 +3913,54 @@ protocol ospf MyOSPF {
 }
 </code>
 
+<sect>Perf
+<label id="perf">
+
+<sect1>Introduction
+<label id="perf-intro">
+
+<p>The Perf protocol is a generator of fake routes together with a time measurement
+framework. Its purpose is to check BIRD performance and to benchmark filters.
+
+<p>Import mode of this protocol runs in several steps. In each step, it generates 2^x routes,
+imports them into the appropriate table and withdraws them. The exponent x is configurable.
+It runs the benchmark several times for the same x, then it increases x by one
+until it gets too high, then it stops.
+
+<p>Export mode of this protocol repeats route refresh from table and measures how long it takes.
+
+<p>Output data is logged on info level. There is a Perl script <cf>proto/perf/parse.pl</cf>
+which may be handy to parse the data and draw some plots.
+
+<p>Implementation of this protocol is experimental. Use with caution and do not keep
+any instance of Perf in production configs for long time. The config interface is also unstable
+and may change in future versions without warning.
+
+<sect1>Configuration
+<label id="perf-config">
+
+<p><descrip>
+       <tag><label id="perf-mode">mode import|export</tag>
+       Set perf mode. Default: import
+
+       <tag><label id="perf-repeat">repeat <m/number/</tag>
+       Run this amount of iterations of the benchmark for every amount step. Default: 4
+
+       <tag><label id="perf-from">exp from <m/number/</tag>
+       Begin benchmarking on this exponent for number of generated routes in one step.
+       Default: 10
+
+       <tag><label id="perf-to">exp to <m/number/</tag>
+       Stop benchmarking on this exponent. Default: 20
+
+       <tag><label id="perf-threshold-min">threshold min <m/time/</tag>
+       If a run for the given exponent took less than this time for route import,
+       increase the exponent immediately. Default: 1 ms
+
+       <tag><label id="perf-threshold-max">threshold max <m/time/</tag>
+       If every run for the given exponent took at least this time for route import,
+       stop benchmarking. Default: 500 ms
+</descrip>
 
 <sect>Pipe
 <label id="pipe">
@@ -3921,7 +4141,7 @@ definitions, prefix definitions and DNS definitions:
        RAdv protocol could be configured to change its behavior based on
        availability of routes. When this option is used, the protocol waits in
        suppressed state until a <it/trigger route/ (for the specified network)
-       is exported to the protocol, the protocol also returnsd to suppressed
+       is exported to the protocol, the protocol also returns to suppressed
        state if the <it/trigger route/ disappears. Note that route export
        depends on specified export filter, as usual. This option could be used,
        e.g., for handling failover in multihoming scenarios.
@@ -3965,6 +4185,12 @@ definitions, prefix definitions and DNS definitions:
        The minimum delay between two consecutive router advertisements, in
        seconds. Default: 3
 
+       <tag><label id="radv-solicited-ra-unicast">solicited ra unicast <m/switch/</tag>
+       Solicited router advertisements are usually sent to all-nodes multicast
+       group like unsolicited ones, but the router can be configured to send
+       them as unicast directly to soliciting nodes instead. This is especially
+       useful on wireless networks (see <rfc id="7772">). Default: no
+
        <tag><label id="radv-iface-managed">managed <m/switch/</tag>
        This option specifies whether hosts should use DHCPv6 for IP address
        configuration. Default: no
@@ -4602,7 +4828,7 @@ protocol rpki {
 filter peer_in_v4 {
        if (roa_check(r4, net, bgp_path.last) = ROA_INVALID) then
        {
-               print "Ignore invalid ROA ", net, " for ASN ", bgp_path.last;
+               print "Ignore RPKI invalid ", net, " for ASN ", bgp_path.last;
                reject;
        }
        accept;