import-route (BGP)

Function

The import-route command imports routes from other protocols.

The undo import-route command removes the imported routes.

By default, BGP does not import any route from other protocols.

Format

import-route { direct | isis process-id | ospf process-id | rip process-id | unr | static } [ med med | route-policy route-policy-name ] *

import-route { direct | isis process-id | ospfv3 process-id | ripng process-id | unr | static } [ med med | route-policy route-policy-name ] *

undo import-route { direct | isis process-id | ospf process-id | rip process-id | unr | static }

undo import-route { direct | isis process-id | ospfv3 process-id | ripng process-id | unr | static }

Parameters

Parameter Description Value
direct Specifies that BGP can import direct route. -
isis Specifies that BGP can import isis route. -
process-id Specifies the ID of an eligible process. -
ospf Specifies that BGP can import ospf route. -
rip Specifies that BGP can import rip route. -
unr Specifies that BGP can import unr route. -
static Specifies that BGP can import static route. -
ospfv3 Specifies that BGP can import ospfv3 route. -
ripng Specifies that BGP can import ripng route. -
med med Specifies the MED metric of the imported route. The value is an integer that ranges from 0 to 4294967295.
route-policy route-policy-name Indicates that routes are filtered by using the Route-Policy specified by the parameter when these routes are imported from other protocols. 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.

Views

BGP view, BGP-VPN instance IPv4 address family view, BGP-VPN instance IPv6 address family view, BGP-IPv4 unicast address family view, BGP-IPv6 unicast address family view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

BGP can import routes by using the import-route command or network command:
  • The import-route command imports routes from a specified protocol into the BGP routing table, such as RIP routes, OSPF routes, IS-IS routes, static routes, or direct routes.
  • The network command imports routes with the specified prefix and mask into the BGP routing table. Compared with the import-route command, the network command ensures the import of more specific routes.
NOTE:

When the import-route static command is run, only active static routes are imported.

Configuration Impact

If the default-route imported (BGP) command has not been used, BGP cannot import default routes when you run the import-route command to import routes from other protocols.

Example

# Import routes from RIP process 1.

<sysname> system-view
[sysname] bgp 100
[sysname-bgp] ipv4-family unicast
[sysname-bgp-af-ipv4] import-route rip 1

Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.