Importation of routes from routing protocols and the installation of the routes in GateD's routing database is controlled by import statements. The format of an import statement varies depending on the source protocol.
In all cases, one of two keywords may be specified to control how routes compete with other protocols:
restrict preference preference
All the formats allow route filters as shown below. See the section on route filters for a detailed explanation of how they work. When no route filtering is specified (i.e. when restrict is specified on the first line of a statement), all routes from the specified source will match that statement. If any filters are specified, only routes that match the specified filters will be imported. Put differently, if any filters are specified, an all restrict is assumed at the end of the list.
network [ exact | refines | between number and number ] network mask mask [exact | refines | between number and number ] network masklen number [ exact | refines | between number and number ] default host host
Only Available in Gated Vession 5 and 6
Normally, routes from unicast routing protocols are only imported into the unicast RIB. Routes from multicast routing protocols (i.e. DVMRP) are only imported into the multicast RIB. However, many multicast routing protocols (e.g., PIM-SM, PIM-DM, CBT) do not maintain their own routing table, but rely on the unicast routing protocol instead. To support these protocols, unicast routes must be imported into the Multicast RIB. If this is not done, only interface routes will be available to PIM-SM, etc.
Since BGP4+ is able to tag routes as to which RIBs they apply, no additional configuration is required for BGP routes.
The RIP, Hello, and Redirect protocols, however, do not do this. Hence, gated must be configured to import RIP (etc) routes into the multicast RIB. See Section 6.4.4.4 to see the exact syntax of the the import protocol statement. One or more RIB names may be specified (where multicast and unicast appear below) as in the example below:
import proto rip { 0.0.0.0 masklen 0 refines; 198.0.0.0 masklen 8 refines multicast unicast; }; This example keeps the normal behavior of allowing all RIP routes in the unicast RIB, but also imports all routes falling under 198/8 into the multicast RIB.
Examples are included in section 6.4.4.7.
To import OSPF routes into the multicast RIB, you currently must import all OSPF routes as follows:
ospf yes { defaults { ribs unicast multicast; ... }; ... };
You may not import OSPF routes into only the multicast RIB. Attempting to do so will be flagged as a configuration error.
import proto bgp | egp autonomoussystem autonomous_system [ aspath-opt ] restrict ; import proto bgp | egp autonomoussystem autonomous_system [ aspath-opt ] [ preference preference ] { route_filter [ restrict | ( preference preference ) ] ; } ; import proto bgp aspath aspath_regexp origin any | ( [ igp ] [egp ] [ incomplete ] ) [ aspath-opt ] restrict ; import proto bgp aspath aspath_regexp origin any | ( [ igp ] [egp ] [ incomplete ] ) [ aspath-opt ] [ preference preference ] { route_filter [ restrict | ( preference preference ) ] ; } ;
EGP importation may be controlled by autonomous system. BGP also supports controlling propagation by the use of an AS path regular expressions, which are documented in the section on Matching AS paths. Note that EGP and BGP versions 2 and 3 only support the propagation of natural networks, so the host and default route filters are meaningless. BGP version 4 supports the propagation of any destination along with a contiguous network mask.
The aspath-opt option allows the specification of import policy based on the path attributes found in the BGP update. (The option is not usable with EGP.) If multiple communities are specified in the aspath-opt option, only updates carrying all of the specified communities will be matched. If none is specified, only updates lacking the community attribute will be matched.
Note that it is quite possible for several BGP import clauses to match a given update. If more than one clause matches, the first matching clause will be used; all later matching clauses will be ignored. For this reason, it is generally desirable to order import clauses from most to least specific. An import clause without an aspath-opt option will match any update with any (or no) communities.
EGP and BGP both store any routes that were rejected implicitly by not being mentioned in a route filter, or explicitly with the restrictkeyword in the routing table with a negative preference. A negative preference prevents a route from becoming active, which prevents it from being installed in the forwarding table, or exported to other protocols. This alleviates the need to break and re-establish a session upon reconfiguration if importation policy is changed.
all versions import proto rip | hello | redirect [ ( interface interface_list ) | (gateway gateway_list ) ] restrict ; Version 3 and 4 Only import proto rip | hello | redirect [ ( interface interface_list ) | (gateway gateway_list ) ] [ preference preference ] { route_filter [ restrict | ( preference preference ) ] ; } ; Version 5 and 6 Only
import proto rip | hello | redirect [ ( interface interface_list ) | (gateway gateway_list ) ] [ preference preference ] [unicast] [ multicast] { route_filter [ restrict | ( preference preference ) ] [ unicast ] [ multicast ] ; } ;
The importation of RIP, HELLO and Redirect routes may be controlled by any of protocol, source interface and source gateway. If more than one is specified, they are processed from most general (protocol) to most specific (gateway).
RIP and HELLO do not support the use of preference to choose between routes of the same protocol. That is left to the protocol metrics. These protocols do not save routes that were rejected since they have short update intervals.
import proto ospfase [ tag ospf_tag ] restrict ; import proto ospfase [ tag ospf_tag ] [ preference preference ] { route_filter [ restrict | ( preference preference ) ] ; } ;
Due to the nature of OSPF, only the importation of ASE routes may be controlled. OSPF intra- and inter-area routes are always imported into the GateD routing table with a preference of 10. If a tag is specified, the import clause will only apply to routes with the specified tag.
It is only possible to restrict the importation of OSPF ASE routes when functioning as an AS border router. This is accomplished by specifying an export ospfase clause. Specification of an empty export clause may be used to restrict importation of ASEs when no ASEs are being exported.
Like the other interior protocols, preference can not be used to choose between OSPF ASE routes. That is done by the OSPF costs. Routes that are rejected by policy are stored in the table with a negative preference.
import proto rip { 0.0.0.0 masklen 0 refines; 198.0.0.0 masklen 8 refines multicast unicast; };
This example keeps the normal behavior of allowing all RIP routes in the unicast RIB, but also imports all routes falling under 198/8 into the multicast RIB.
import proto rip { 0.0.0.0 masklen 0 refines multicast unicast; };
This example imports all RIP routes into the multicast RIB (as well as the usual unicast RIB). This would be used, for example, in a PIM-SM domain using RIP as the unicast routing protocol.
import proto rip unicast multicast { all ; };
This examples imports all of RIP routes into the unicast and multicast ribs.
ospf yes { defaults { ribs unicast multicast; ... }; ... };
This example inserts all of the OSPF routes into the unicast and multicast ribs.
Last updated November 29, 1997.
gated@gated.merit.edu