< Home

import-route (OSPF)

Function

The import-route command imports routes learned by other protocols.

The undo import-route command cancels the configuration.

By default, routes learned by other protocols are not imported.

Format

import-route { limit limit-number | { bgp [ permit-ibgp ] | direct | unr | rip [ process-id-rip ] | static | isis [ process-id-isis ] | ospf [ process-id-ospf ] } [ cost cost | type type | tag tag | route-policy route-policy-name ] * }

undo import-route { limit | bgp | direct | unr | rip [ process-id-rip ] | static | isis [ process-id-isis ] | ospf [ process-id-ospf ] }

Only the S5720-EI, S5720-HI, S5720I-SI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730-HI, S5730S-EI, S5730-SI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6720S-SI, S6720-SI, S6730-H, S6730S-H, S6730-S, and S6730S-S support the bgp [ permit-ibgp ] and isis [ process-id-isis ] parameter.

Parameters

Parameter Description Value

bgp

Specifies the BGP protocol whose routes are imported.

NOTE:

If this parameter is specified, only EBGP routes can be imported; IBGP routes cannot be imported.

-

permit-ibgp

IBGP routes that are permitted to be imported.

NOTE:

The import of IBGP routes may cause route loops. Therefore, this command must not be configured unless it is necessary.

-

direct

Specifies the direct protocol whose routes are imported.

-

unr

Specifies the imported source routing protocol as unr.

User Network Route (UNR) is allocated if dynamic routing protocols cannot be used when users are getting online.

-

rip

Specifies the RIP protocol whose routes are imported.

-

process-id-rip

Specifies the process ID of the protocol whose routes are imported.

The value is an integer ranging from 1 to 65535. The default value is 1.

static

Specifies the static protocol whose routes are imported.

-

isis

Specifies the IS-IS protocol whose routes are imported.

-

process-id-isis

Specifies the process ID of the protocol whose routes are imported.

The value is an integer ranging from 1 to 65535. The default value is 1.

ospf

Specifies the OSPF protocol whose routes are imported.

-

process-id-ospf

Specifies the process ID of the protocol whose routes are imported.

The value is an integer ranging from 1 to 65535. The default value is 1.

limit limit-number

The maximum number of external routes that can be imported into an OSPF process.

The value is an integer that ranges from 1 to 4294967295.

cost cost

Indicates the route cost.

The value is an integer ranging from 0 to 16777214. By default, it is 1.

route-policy route-policy-name

Imports only the route that meets the requirements of the specified route-policy.

The name is a string of 1 to 40 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.

tag tag

Specifies the tag of the external LSA.

The value is an integer ranging from 0 to 4294967295. By default, it is 1.

type type

Specifies the type of the external routes.

The value is an integer ranging from 1 to 2. By default, it is 2.
  • 1: Type 1 external route
  • 2: Type 2 external route

Views

OSPF view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Importing routes discovered by other routing protocols can enrich OSPF routing information.

OSPF routes are classified into the following types in the descending order of priorities:

  • Intra-area routes: refer to the routes in an area within an autonomous system.

  • Inter-area routes: refer to the routes between different areas of the same AS. Intra-area routes and area external routes are internal routes of an AS.

  • Type 1 external routes: When the cost of external routes equals that of AS internal routes, and can be compared with the cost of OSPF routes, these external routes have a high reliability and can be configured as Type 1 external routes.

  • Type 2 external routes: When the cost of the routes from an ASBR to the destination outside an AS is much greater than the cost of the internal routes to the ASBR, these external routes have a low reliability and can be configured as Type 2 external routes.

On a non-PE device, only EBGP routes are imported after the import-route bgp command is configured. IBGP routes are also imported after the import-route bgp permit-ibgp command is configured. If IBGP routes are imported, routing loops may occur. To prevent loops, run the preference (OSPF) and preference (BGP) commands to specify preferences for OSPF and BGP routes. If IBGP routes need to be imported, run the import-route bgp permit-ibgp command, and run the preference (OSPF) and preference (BGP) commands to set the preference of OSPF ASE routes lower than that of IBGP routes (preference value of OSPF ASE routes larger than that of IBGP routes).

On a PE, configuring the import-route bgp command imports both EBGP routes and IBGP routes, regardless of whether the import-route bgp permit-ibgp command is configured or not. If the import-route bgp permit-ibgp command and the default-route-advertise (OSPF) command are both configured, the active IBGP default routes can be imported into OSPF.

Prerequisites

To import certain external routes using a route-policy, a route-policy must have been created using the route-policy command before running the import-route command.

Configuration Impact

After a route-policy is configured, the OSPF process imports only routes that satisfy certain conditions. This prevents devices from receiving unrequired routes.

Precautions

You can use the default (OSPF) command to configure default parameters for external routes imported by OSPF, including the cost, type (Type 1 or Type 2), tag, and number of routes.

The import-route (OSPF) command cannot import the default route of an external protocol. To enable a device to advertise the default route of an external protocol it learns when updating the OSPF routing table to other devices within the area, run the default-route-advertise (OSPF) command.

After the import-route direct command is executed, routes to the network segment where the IP address of the management interface belongs are also imported in the OSPF routing table. Therefore, use this command with caution.

Creating a route-policy before it is referenced is recommended. By default, nonexistent route-policies cannot be referenced using the command. If the route-policy nonexistent-config-check disable command is run in the system view and a nonexistent route-policy is referenced using the current command, all the routes learned by the specified protocol are imported to the OSPF routing table.

Example

# Import Type 2 RIP routes, with the process 40, the tag being 33 and cost being 50.

<HUAWEI> system-view 
[HUAWEI] ospf 100
[HUAWEI-ospf-100] import-route rip 40 type 2 tag 33 cost 50
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >