Configuring external route redistribution in an OSPF domain (optional)

For more information, see Configuring for external route redistribution in an OSPF domain.

Configuring redistribution filters

Syntax:

router ospf restrict ip-addr/mask-length

Prevents distribution of the specified range of external routes through an ASBR from sources external to the OSPF domain.

Default: Allow all supported, external route sources


[NOTE: ]

NOTE: Use this command to block unwanted, external routes before enabling route redistribution on the ASBR.


Example:

To configure a routing switch operating as an ASBR to filter out redistribution of static, connected, or RIP routes on network 10.0.0.0, enter the following commands:

HP Switch(config)# router ospf restrict 10.0.0.0/8

[NOTE: ]

NOTE: In the default configuration, redistribution is permitted for all routes from supported sources.


Enabling route redistribution

This step enables ASBR operation on a routing switch, and must be executed on each routing switch connected to external routes you want to redistribute in your OSPF domain.

The basic form of the redistribute command redistributes all routes of the selected type. For finer control over route selection and modification of route properties, you can specify the route-map parameter and the name of a route map. (For general information on route policy and route maps, see Route Policy. For examples of using route maps in route redistribution, see Using route policy in route redistribution.)


[NOTE: ]

NOTE: Do not enable redistribution until you have configured the redistribution "restrict" filters. Otherwise, the network might become overloaded with routes that you did not intend to redistribute.


Syntax:

[no] router ospf redistribute [ connected | static | rip ] route-mapname

Executed on an ASBR to globally enable redistribution of the specified route type to the OSPF domain through the area in which the ASBR resides.

static

Redistribute from manually configured routes.

connected

Redistribute from locally connected networks.

rip

Redistribute from RIP routes.

route-map name

Optionally specify the name of a route-map to apply during redistribution.

The no form of the command disables redistribution for the specified route type.

Example

To enable redistribution of all supported external route types through a given ASBR, execute the following commands.

HP Switch(config)# router ospf redistribution connected
HP Switch(config)# router ospf redistribution static
HP Switch(config)# router ospf redistribution rip

Modifying the default metric for redistribution

Optional: The default metric is a global parameter that specifies the cost applied to all OSPF routes by default.

Syntax:

router ospf default-metric 0-16777215

Globally assigns the cost metric to apply to all external routes redistributed by the ASBR. By using different cost metrics for different ASBRs, you can prioritize the ASBRs in your AS.

Default: 10

Example:

To assign a default metric of 4 to all routes imported into OSPF on an ASBR, enter the following commands:

HP Switch()#
HP Switch(config)# router ospf default-metric 4

Modifying the redistribution metric type

Optional: The redistribution metric type is used by default for all routes imported into OSPF. Type 1 metrics are the same "units" as internal OSPF metrics and can be compared directly. Type 2 metrics are not directly comparable, and are treated as larger than the largest internal OSPF metric.

Syntax:

router ospf metric-type [ type1 | type2 ]

Globally reconfigures the redistribution metric type on an ASBR.

type1

Specifies the OSPF metric plus the external metric for an external route.

type2

Specifies the external metric for an external route.

Default: type2

Example:

To change from the default setting on an ASBR to type 1, enter the following command:

HP Switch(config)# router ospf metric-type type1