This restricts all routes that have one or more occurrences of
autonomous system number 164 in their path vector.
B.10.2. The export Statement
The syntax of the export statement
is similar to the syntax of the import statement,
and the meanings of many of the parameters are identical. An
important difference between the two statements is that while route
importation is controlled by source information, route exportation is
controlled by both source and destination. Thus,
export statements define where the routes will be
sent and where they originated. The destination of the route
advertisement is defined by the proto clause at
the beginning of the export statement. The source
of the routes is defined in the export list.
The export statement varies slightly for each
protocol. To advertise routes via EGP and BGP, use this syntax:
export proto bgp | egp as as_number
[restrict] |
[[metric metric] {
export_list ; }] ;
Routes are exported via EGP and BGP to the specified autonomous
system. restrict blocks exports to the AS. Valid
BGP or EGP metrics can be specified. If no export list is defined,
only the direct routes of the attached interfaces are exported. If an
export list is used, it must explicitly specify everything that
should be exported.
To advertise routes via RIP, use this syntax:
export proto rip
[interface interface_list | gateway gateway_list]
[restrict] |
[[metric metric] {
export_list ; }] ;
Routes exported by RIP can be sent through a specific interface or to
a specific gateway. Set metric if you plan
to export static or internally generated default routes. The
metric option is used only when exporting non-RIP
routes via RIP.
If no export list is specified, RIP exports direct routes and RIP
routes. If an export list is used, it must explicitly specify
everything that should be exported.
To advertise routes via OSPF, use this syntax:
export proto osfpase [type 1 | 2] [tag ospf_tag]
[restrict] |
[[metric metric] {
export_list ; }] ;
Only OSPF ASE routes can be exported by gated.
There are two types of OSPF ASE routes, type 1 and type 2. They are
described in Chapter 7, "Configuring Routing " and earlier in this
appendix. The default type is specified in the ospf
protocol statement, but it can be overridden here. The
ospf_tag is an arbitrary 32-bit number
used to filter routing information. The default tag value is
specified in the ospf protocol statement, but it
can be overridden here.
The source of the routes advertised by a protocol is defined by the
export list. Each of the commands listed above contains an export
list option. Just like those commands, the export list syntax varies
depending on the source protocol of the routes. The commands
described above define the protocols that are used to advertise the
routes. The export lists shown below describe the protocols from
which the routes are obtained. The biggest confusion caused by the
export list syntax is that it is almost identical to the syntax shown
above. In both cases we define protocols, autonomous systems,
interfaces, gateways, and so on. In the first case we are defining
the protocols, interfaces, etc., to which routes are sent, and in
this case we are defining the protocols, interfaces, etc., from which
routes are received.
To export routes learned from BGP and EGP, use this export list
syntax:
export proto bgp | egp autonomoussystem as_number
[restrict [noagg]] |
[[metric metric] {
route_filter [restrict | metric metric] ; }] ;
This defines routes learned via BGP or EGP from a specific autonomous
system. Routes can be restricted, or have a metric applied, based on
matching the source AS number or the route filter.
noagg can be used with restrict
to prevent any aggregate routes from matching the filter.
When BGP is configured, gated assigns all routes
an AS path. For interior routes, the AS path specifies
igp as the origin and no autonomous systems in the
AS path (the current AS is added when the route is exported). For EGP
routes, the AS path specifies egp as the origin
and the source AS as the AS path. For BGP routes, the AS path learned
from BGP is used. If you run BGP, the export of all routes may be
controlled by the AS path using this syntax:
proto proto | all
aspath aspath_regexp origin any | igp | egp | incomplete
[restrict] |
[[metric metric] {
route_filter [restrict | metric metric] ; }] ;
The source of the routes can be any one protocol
(proto) or all protocols
(all). The importation of routes can be controlled
by matching their AS paths against the AS path regular expression
(aspath_regexp) or by matching their
addresses against the route_filter. Route
filters and AS path regular expressions were explained previously.
To export routes learned from RIP, use this export list syntax:
proto rip
[interface interface_list | gateway gateway_list]
[restrict] |
[[metric metric] {
route_filter [restrict | metric metric] ; }] ;
The export of RIP routes may be controlled by source interface,
source gateway, or route filter.
To export routes learned from OSPF, use this export list syntax:
proto ospf | ospfase
[restrict] |
[[metric metric] {
route_filter [restrict | metric metric] ; }] ;
The export of OSPF and OSPF ASE routes may be controlled by protocol
and route filter. Exporting OSPF routes can also be controlled by
tag using the following syntax:
proto proto | all tag tag
[restrict] |
[[metric metric] {
route_filter [restrict | metric metric] ; }] ;
OSPF and RIP version 2 provide a tag field. For all other protocols,
the tag is always 0. Routes may be selected based on the contents of
the tag field.
There are other sources of routes that are not true routing
protocols, and export lists can be defined for these sources. The two
export lists for these sources are:
proto direct | static | kernel
[interface interface_list]
[restrict] |
[[metric metric] {
route_filter [restrict | metric metric] ; }] ;
The export of these routes can be controlled based on the source
"protocol" and the source interface. The
"protocols" in this case are routes to direct interfaces,
static routes, or routes learned from the kernel.
proto default | aggregate
[restrict] |
[[metric metric] {
route_filter [restrict | metric metric] ; }] ;
The export of these routes may only be controlled based on source
"protocol." default refers to routes
created by the gendefault option.
aggregate refers to routes created by the
aggregate statements, the topic of the next section.