< Home

import-route (BGP)

Function

The import-route command configures BGP to import routes of other routing protocols and types.

The undo import-route command restores the default setting.

By default, BGP does not import routes.

Format

import-route protocol [ process-id ] [ med med | route-policy route-policy-name ] *

undo import-route protocol [ process-id ]

Parameters

Parameter Description Value
protocol Specifies the routing protocol type and route type. The BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, and BGP-VPN instance IPv4 address family view support direct, isis, ospf, rip, static, and unr. The BGP-IPv6 unicast address family view and BGP-VPN instance IPv6 address family view support direct, isis, ospfv3, ripng, static, and unr.
process-id Specifies a process ID if BGP is configured to import routes. If protocol is direct, static, or unr, no process ID is required. The value is an integer that ranges from 1 to 65535.
med med Specifies the MED. The value is an integer that ranges from 0 to 4294967295.
route-policy route-policy-name Indicates that routes are filtered and route attributes are modified 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-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-IPv6 unicast address family view, BGP-VPN instance IPv6 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:
  • In import mode, BGP imports IGP routes, including RIP, OSPF, and IS-IS routes, into the BGP routing table based on protocol type. To ensure the validity of imported IGP routes, BGP can also import static routes and direct routes in import mode.

  • In network mode, BGP imports the routes in the IP routing table one by one into the BGP routing table. The network mode is more accurate than the import mode.

Precautions

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

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 BGP 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 routes of the specified protocol are imported to the BGP routing table.

Example

# Import routes from RIP process 1.

<HUAWEI> system-view
[HUAWEI] bgp 100
[HUAWEI-bgp] ipv4-family unicast
[HUAWEI-bgp-af-ipv4] import-route rip 1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >