import-route

Use import-route to enable BGP to redistribute routes from an IGP protocol.

Use undo import-route to disable route redistribution from an IGP protocol.

Syntax

import-route protocol [ { process-id | all-processes } [ med med-value | route-policy route-policy-name ] * ]

undo import-route protocol [ process-id | all-processes ]

Default

BGP does not redistribute IGP routes.

Views

BGP IPv4 unicast address family view

BGP-VPN IPv4 unicast address family view

BGP IPv6 unicast address family view

BGP-VPN IPv6 unicast address family view

BGP IPv4 multicast address family view

BGP IPv6 multicast address family view

Predefined user roles

network-admin

Parameters

protocol: Redistributes routes from an IGP protocol.

process-id: Specifies a process by its ID in the range of 1 to 65535. The default is 1. For IPv4 routes, it is available only when the protocol is isis, ospf, or rip. For IPv6 routes, it is available only when the protocol is isisv6, ospfv3, or ripng.

all-processes: Redistributes routes from all the processes of the specified IGP protocol. For IPv4 routes, this keyword takes effect only when the protocol is isis, ospf, or rip. For IPv6 routes, this keyword takes effect only when the protocol is isisv6, ospfv3, or ripng.

med med-value: Specifies a MED value for redistributed routes, in the range of 0 to 4294967295. If you do not specify an MED, the metric of a redistributed route is used as its MED.

route-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to filter redistributed routes or set route attributes for redistributed routes.

Usage guidelines

The import-route command cannot redistribute default IGP routes. To redistribute default IGP routes, use the default-route imported command together with the import-route command.

Only active routes can be redistributed. You can use the display ip routing-table protocol or display ipv6 routing-table protocol command to view route state information.

The ORIGIN attribute of routes redistributed by the import-route command is INCOMPLETE.

Examples

# In BGP IPv4 unicast address family view, redistribute routes from RIP process 1, and set the MED value for redistributed routes to 100.

<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] import-route rip 1 med 100

Related commands

display ip routing-table protocol

display ipv6 routing-table protocol