< Home

Configuring OSPF to Import External Routes

Context

To communicate with a switch running a protocol other than OSPF, an OSPF-capable switch must import routes of this protocol into the OSPF network.

OSPF can ensure loop-free intra-area and inter-area routes; however, OSPF cannot prevent external route loops. Therefore, exercise caution to prevent loops caused by manual configurations when importing external routes to OSPF.

Perform the following steps on the switch functioning as an ASBR running OSPF.

Procedure

  • Configure OSPF to import the routes discovered by other protocols.
    1. Run system-view

      The system view is displayed.

    2. Run ospf [ process-id ]

      The OSPF process view is displayed.

    3. Run 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 ] * }

      The switch is configured to import routes discovered by other protocols.

      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 ] parameters.

  • Set parameters for OSPF to import routes.
    1. Run system-view

      The system view is displayed.

    2. Run ospf [ process-id ]

      The OSPF process view is displayed.

    3. Run default { cost { cost-value | inherit-metric } | limit limit | tag tag | type type } *

      The parameters (route cost, tag, and type) for route import are set to the default values.

      The tag parameter is used to identify protocol-related information. For example, it can differentiate AS numbers carried in BGP routes imported by OSPF.

      By default, the cost of the external routes imported by OSPF is 1, the type of the imported external routes is Type 2, and the tag value of the imported routes is 1.

      To set a cost for an imported route, run one of the following commands (listed in descending order of priority).
      • apply cost
      • import-route
      • default (default cost)

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >