The import-route command imports routes from other routing protocols.
The undo import-route command cancels importing routes from other routing protocols.
By default , import no routes from other routing protocols.
import-route bgp [ permit-ibgp ] [ cost { cost | transparent } | route-policy route-policy-name ] *
import-route { { static | direct | unr } | { { rip | ospf | isis } [ process-id ] } } [ cost cost | route-policy route-policy-name ] *
undo import-route { { static | direct | bgp | unr } | { { rip | ospf | isis } [ process-id ] } }
| Parameter | Description | Value |
|---|---|---|
| bgp | static | direct | rip | ospf | isis | Specifies the protocol of the routes that are imported by RIP. | - |
| permit-ibgp | Specifies that IBGP routes are imported by RIP process in public instance. | - |
| process-id | Specifies the ID of a process. If the protocol is IS-IS, OSPF, or RIP, the process ID needs to be specified. | The value is an integer ranging from 1 to 65535. |
| cost | Specifies the cost of the imported route. If no cost is specified, use the default-cost (RIP) command to set the default cost. | The value is an integer ranging from 0 to 15. |
| transparent | Is valid only when BGP routes are imported. The cost of the imported routes is the Multi_Exit Discriminator (MED) value of BGP routes. | - |
| route-policy route-policy-name | Specifies the name of the configured routing policy when external routes are imported. | The value must be the name of an existing routing policy. |
By configuring the routing policy, you can import specific routes and set route attributes.
When the routes to be imported are RIP routes, OSPF routes, or IS-IS routes, the process ID can be specified to import only routes from a specified process. If no process ID is specified, all RIP routes, OSPF routes, or IS-IS routes are imported. When the routes to be imported are static routes or direct routes, no process ID can be specified.
You can run one of the following commands to set the cost of the imported route. The following commands are listed in descending order of priorities.
Run the apply cost command to set the cost of a route.
Run the import-route (RIP) command to set the cost of the imported route.
Run the default-cost (RIP) command to set the cost of the default route.
# Import a route from IS-IS process 7 and set the cost of the route to 7.
<FW> system-view
[FW] rip 1
[FW-rip-1] import-route isis 7 cost 7
# Import IBGP routes in RIP process 1 with cost 5 and route-policy abc.
<FW> system-view
[FW] rip 1
[FW-rip-1] import-route bgp permit-ibgp cost 5 route-policy abc