import-route
Use import-route to enable route redistribution from another routing protocol.
Use undo import-route to remove routes redistributed from another routing protocol.
Syntax
import-route protocol [ as-number ] [ process-id | all-processes | allow-ibgp ] [ allow-direct | cost cost-value | route-policy route-policy-name | tag tag ] *
undo import-route protocol [ process-id | all-processes ]
Default
RIP does not redistribute routes from any other routing protocol.
Views
RIP view
Predefined user roles
network-admin
Parameters
protocol: Specifies a routing protocol from which RIP redistributes routes.
as-number: Specifies an AS by its number in the range of 1 to 4294967295. This argument applies only to the BGP protocol. If you do not specify the as-number argument, this command redistributes all IPv4 EBGP routes. As a best practice, specify the AS number to avoid redistributing excessive IPv4 EBGP routes.
process-id: Specifies a process by its ID in the range of 1 to 65535. The default is 1. This argument is available only when the protocol is isis, ospf, or rip.
all-processes: Enables route redistribution from all the processes of the specified protocol. This keyword takes effect only when the protocol is rip, ospf, or isis.
allow-ibgp: Allows redistribution of IBGP routes. This keyword is available when the protocol argument is set to bgp.
allow-direct: Redistributes the networks of the local interfaces enabled with the specified routing protocol. By default, the networks of the local interfaces are not redistributed. If you specify both the allow-direct keyword and the route-policy route-policy-name option, make sure the if-match rule defined in the routing policy does not conflict with the allow-direct keyword. For example, if you specify the allow-direct keyword, do not configure the if-match route-type rule for the routing policy. Otherwise, the allow-direct keyword does not take effect.
cost cost-value: Specifies a cost for redistributed routes, in the range of 0 to 16. The default cost is 0.
route-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters.
tag tag: Specifies a tag for marking redistributed routes, in the range of 0 to 65535. The default is 0.
Usage guidelines
This command redistributes only active routes. To view route state information, use the display ip routing-table protocol command.
The import-route bgp command redistributes only EBGP routes. The import-route bgp allow-ibgp command additionally redistributes IBGP routes and might cause routing loops. Therefore, use it with caution.
The undo import-route protocol all-processes command removes only the configuration made by the import-route protocol all-processes command. It does not remove the configuration made by the import-route protocol process-id command.
Examples
# Redistribute static routes into RIP, and set the cost for redistributed routes to 4.
<Sysname> system-view [Sysname] rip 1 [Sysname-rip-1] import-route static cost 4
Related commands
default cost