The import-route command configures BGP to import routes from other protocols.
The undo import-route command cancels the configuration.
By default, BGP does not import routes from other protocols.
import-route { static | direct | unr } [ [ med med-value ] | [ [ route-policy route-policy-name ] | [ route-filter route-filter-name ] ] ] *
import-route { unr | { ospf | isis | rip } processId } [ [ med med-value ] | [ [ route-policy route-policy-name ] | [ route-filter route-filter-name ] ] ] *
undo import-route { static | direct | unr }
undo import-route { { ospf | isis | rip } processId }
Parameter | Description | Value |
---|---|---|
static |
Configures BGP to import static routes. |
- |
direct |
Configures BGP to import direct routes. |
- |
unr |
Configures BGP to import UNR routes. |
- |
med med-value |
Specifies the MED for imported routes. |
The value is an integer ranging from 0 to 4294967295. |
route-policy route-policy-name |
Specifies the route-policy used to filter routes and modify route attributes when these routes are imported from other protocols. |
The name is a string of 1 to 200 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
route-filter route-filter-name |
Specifies the route-filter used to filter routes and modify route attributes when these routes are imported from other protocols. |
The value is a string of 1 to 200 case-sensitive characters, spaces not supported. If parameters are included in the referenced route-filter, specify values for them in the format of (var1, var2, ...var8) behind the route-filter name. A maximum of eight parameters can be specified, and each value ranges from 1 to 200 characters. |
ospf |
Configures BGP to import OSPF routes. |
- |
isis |
Configures BGP to import IS-IS routes. |
- |
rip |
Configures BGP to import RIP routes. |
- |
processId |
Specifies the number of a process from which routes are to be imported. |
The value is an integer ranging from 1 to 4294967295. |
Usage Scenario
BGP can import routes using the import-route command or network command:
Configuration Impact
If the default-route imported command has not been used when you run the import-route command to import routes from other protocols, BGP cannot import default routes.
<HUAWEI> system-view [~HUAWEI] ip vpn-instance vpna [*HUAWEI-vpn-instance-vpna] ipv4-family [*HUAWEI-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1 [*HUAWEI-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both [*HUAWEI-vpn-instance-vpna-af-ipv4] quit [*HUAWEI-instance-vpna] quit [*HUAWEI] bgp 100 instance a [*HUAWEI-bgp-instance-a] ipv4-family vpn-instance vpna [*HUAWEI-bgp-instance-a-vpna] import-route ospf 1
<HUAWEI> system-view [~HUAWEI] ip vpn-instance vpna [*HUAWEI-vpn-instance-vpna] ipv4-family [*HUAWEI-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1 [*HUAWEI-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both [*HUAWEI-vpn-instance-vpna-af-ipv4] quit [*HUAWEI-instance-vpna] quit [*HUAWEI] bgp 100 instance a [*HUAWEI-bgp-instance-a] ipv4-family vpn-instance vpna [*HUAWEI-bgp-instance-a-vpna] import-route static