| << Previous | Contents Index | Next >> |
The route-file and generate statements (see below) generate files. Use the provide statement in the host block to choose which host will run the file generation process. See Distributing files.
The file format is:
netname ip-address/mask-bits # timestamp
with the timestamp indicating the last time the route was found in the routing table. The file can be included into the configuration inside an ip statement, i.e ip @filename. The route-expire timeout statement controls how long routes are kept in the output file after they have disappeared from the routing table. The default is two days.
The route-source source statement, if provided, specifies the source containing the router address and router password statements (at a minimum) required to connect to a Cisco router and dump its routing or BGP table.
If no route-source statement is provided, and the extraction type is routes or bgp, the local Quagga database is connected to via the vtysh utility. For this to work, the ipacc user must be able to access the Zebra or BGP process's command socket. Typically, this is done by adding the ipacc user to the Quagga group in /etc/group, e.g.
quagga:*:101:ipacc
| local | Select networks that are routed according to local configuration, either a static routes or associated with local interfaces. |
| learned | Select network routes learned via a routing protocol. |
| connected | Select networks associated with local interfaces. |
| static | Select networks referred to by static routes. |
| bgp | Select network routes learned via BGP. |
| rip | Select network routes learned via RIP. |
| eigrp | Select network routes learned via EIGRP. |
| ospf | Select network routes learned via OSPF. |
| isis | Select network routes learned via IS-IS. |
| igrp | Select network routes learned via IGRP. |
| egp | Select network routes learned via EGP. |
| exterior | Select networks learned via BGP or EGP, or marked as exterior by OSPF, IS-IS or EIGRP. |
| interior | Select networks learned by interior routing protocols and not marked as exterior. |
| interface interface | |
| Select networks associated with interface. | |
| nexthop address-range | |
| Select network routes with a next hop IP address inside address-range. | |
| ip address-range | |
| Select network routes where the route is within address-range. | |
| as-path regular-expression | |
| Select network routes based on the BGP AS path using a regular expression. | |
Note that not all keywords are meaningful given a particular route extraction mechanism. For example, bgp extracts do not provide an interface; kernel and routes do not provide BGP AS paths, and kernel routes generally are not aware of the routing processes that put them there.
Where multiple filters are specified on one route-select line, they are treated as a logical AND; where the same keyword is provided, they form a logical OR within that keyword. For example, the statement:
route-select known ip 192.168.0.0/16 ip 10.0.0.0/8 interface eth0
would match any route within 192.168.0.0/16 or 10.0.0.0/8, as long as it went via the interface eth0. Where overlapping filters (or overlapping data in the same filter) are applied, the last entry takes priority.
BGP paths are selected using a regular expression. Regular expressions are as described under Regular expressions except that the '_' character has special meaning. '_' can match the start of a line, the end of a line, any whitespace or the ',', '{', '}', '(', and ')' characters. Note that if a regular expression contains spaces, it must be quoted.
The route-ignore [!]filter ... statement allows some routes to be selected that will be ignored. Selections are as for route-select. The route-ignore list is processed before the route-select list.
Note that the default route, i.e. 0.0.0.0/0 is specifically excluded from the output, so routing tables containing a default route can be parsed by route-file processing. Routes to multicast, invalid and loopback addresses are similarly rejected.
The route-remove netname address-range ... statement provides the same functionality as route-ignore ip address-range, however the statement format makes it compatible with include files in the form netname address .... Note that netname is ignored.
The nexthop netname address-range ... statement provides an abbreviated form of the route-select statement, largely for backwards compatibility. For example, the statement
nexthop local 192.168.1.0/24 192.168.2.0/24
is exactly equivalent to:
route-select local nexthop 192.168.1.0/24 nexthop 192.168.2.0/24
The route-list name address-range statement adds an entry into the list of IP addresses to filter. If this list exists, the list will be consulted after reading the routing table, and only those entries for which a corresponding routing table entry was found will be output.
The route-list-select filter statement specifies the filter criteria for the networks specified by route-list. filter is as for the route-select statement.
The route-list and route-list-select statements must not be used with the route-select or nexthop statements. route-ignore mat be used with both.
| << Previous | Contents Index | Next >> |