Configuration Guide Vol. 3


14.1.4 OSPF [SL-L3A]

<Structure of this section>

(1) OSPF learned route filtering

Of the routes computed by the SPF algorithm, OSPF only allows external AS routes and NSSA routes to be filtered. External AS routes and NSSA routes that do not pass the filter are entered into the routing table as invalid routes.

Intra-area and inter-area routes are not filtered before entering the routing table.

Even when a route is disabled by the learned route filtering process, corresponding routes are still formed in other routers. This is because the LSA that originates the route is propagated to the other routers within the OSPF domain. Learned route filtering filters the external AS routes and NSSA routes generated from the LSA, but not the LSA itself.

(a) How and in which order filters are applied

The switch filters the external AS routes and NSSA routes subject to the filters specified in the distribute-list in command. The table below describes the configuration command used to filter learned routes in OSPF.

If there are no applicable filters or every filter gives a permit result, the route is entered into the routing table as a valid route. The route is deemed an invalid route if it is denied by a filter.

Table 14-10: OSPF learned route filtering configuration command

Command name

Filtered routes

distribute-list in (OSPF)

Filters external AS routes and NSSA routes calculated in the designated OSPF domain.

(b) Route attributes changeable by learned route filtering

The table below describes the attribute that can be changed by OSPF learned route filtering.

OSPF learned route filtering can only change distance values. The modified distance value is used to define the relative priority of routing protocols.

Table 14-11: Routes that can be changed by OSPF learned route filtering

Attribute

Default

Distance

The value specified by distance ospf (OSPF).

110 if not specified.

(2) OSPF advertised route filtering

In OSPF, a directly connected route of an OSPF interface is advertised as an intra-area or inter-area route. This behavior is outside the control of advertised route filtering.

OSPF routes are also propagated to other routers. This also cannot be controlled by route filtering. This is because an LSA that originates a route is propagated unconditionally regardless of what filters are in place.

You can use advertised route filtering to advertise prioritized routes other than the above to OSPF. Such routes will be advertised as external AS routes or NSSA routes.

If you do not configure advertised route filtering, the OSPF protocol advertises no routes except OSPF routes and directly connected routes of OSPF interfaces.

(a) Route attributes changeable by advertised route filtering

The following table describes the attributes that can be changed by OSPF advertised route filtering.

Table 14-12: External OSPF AS routes changeable by OSPF advertised route filtering

Attribute

Learning source protocol

Default

Metric

Directly connected route

20

BGP4 route

The value specified by default-metric (OSPF).

1 if there is no default-metric setting.

Other cases

The value specified by default-metric (OSPF).

If no value is specified, 20 is used.

OSPF route type

Common to all protocols

Type 2 external AS or NSSA route

Tag value

Common to all protocols

Inherits the tag value of the routing information.

Notes

You can also set the metric value to change to 16777215 or higher. However, such a route will not be advertised.

(b) How and in which order filters are applied

The application of advertised route filtering involves the following steps:

  1. First, select the routes to be advertised by OSPF. Specify the learning source protocol of the routes you want to advertise. By specifying a route type in the redistribute command, you can limit advertised routes to those of a certain type. However, you cannot re-advertise the routes of a given OSPF domain by specifying it in the redistribute command.

    By specifying a route type in the redistribute command, you can limit advertised routes to those of a certain type. By specifying route-map, you can advertise only those routes that the associated filters permit. The redistribute command compares the route attributes in the routing table against the conditions in route-map.

    You can also change the attributes of advertised routes by specifying the new values directly in the redistribute command, or by specifying route-map in the redistribute command that changes the route attributes.

  2. The advertised route takes on the default metric and OSPF route type configured for the protocol. If you used the redistribute command to change the attribute value, the route retains the attribute value assigned by the command.

    For details about the default advertised route attributes for OSPF, see Attributes of external OSPF AS routes changeable by 14-12 OSPF advertised route filtering.

  3. Use the parameters of the distribute-list out command to filter the routes selected by the redistribute command. If you specify a protocol in the command parameters, the filter applies only to routes learned by the specified protocol. The table below describes the configuration command and its parameters.

    When advertising routes to an OSPF domain, applicable filters are selected according to the learning source protocol, and applied in the order shown in the table. The route is advertised if there are no applicable filters or every filter gives a permit result. The route is not advertised if it is denied by even one filter.

    If you specify route-map in the distribute-list out command, routes are filtered according to the default advertising attributes and the attributes after modification by the redistribute command.

    You can also change an attribute of an advertised route by specifying route-map in the distribute-list out command that performs the desired change.

Notes

If you execute the match route-type command while performing advertised route filtering by means of the distribute-list out command in step 3, routes will match external, and external 1 or external 2. This is because the OSPF route type in the route attribute will already have been rewritten to indicate a type 1 or type 2 external route.

Table 14-13: OSPF advertised route filtering configuration command

Command name

Parameter

Filtered routes

distribute-list out (OSPF)

<Protocol>

Filters routes matching a specific protocol regardless of their advertising destination.

No

Filters all routes regardless of their advertising destination.