The default-route originate command configures a device to generate a default route and advertise it to its neighbors, or advertise an exist default route to its neighbors.
The undo default-route originate command deletes the default route.
By default, the device does not advertise the default route to its neighbors.
Parameter | Description | Value |
---|---|---|
cost |
Specifies the metric value to be applied while generating a default route. |
The value is an integer that ranges from 0 to 15. The default value is 0. |
cost cost |
Specifies the metric value to be applied while generating a default route. |
The value is an integer that ranges from 0 to 15. The default value is 0. |
tag tag |
Specifies the tag value to be applied while advertising a default route. |
The value is an integer that ranges from 0 to 65535. The default value is 0. |
match default |
Advertises the default routes (if any) in the routing table generated by other routing protocols or RIP processes to neighbors. |
- |
route-policy route-policy-name |
Specifies the name of a route-policy. RIP generates the default route only if the route that matches the route-policy is active in the routing table. To configure a route-policy, run the route-policy command. |
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. |
advertise-tag |
Specifies inherit the tag value applied through route-policy while advertising default route. |
- |
route-filter route-filter-name |
Specifies the name of a route-filter. RIP generates the default route only if the route that matches the route-policy is active in the routing table. |
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. |
avoid-learning |
Prevents a RIP process from importing default routes. If there is an active default route in the routing table and avoid-learning is specified, the default route becomes inactive. |
- |
Usage Scenario
In a routing table, the destination address and mask of a default route are all 0s. If the destination address of a packet does not match any entry in the routing table of the device, the device sends the packet along the default route.
If no default route exists and the destination address of the packet does not match any entry in the routing table, the device discards the packet and sends an Internet Control Message Protocol (ICMP) packet, informing the originating host that the destination address or network is unreachable. Default routes are originated unconditionally, or based on the configured route-policy or match default. When default routes are originated based on the configuration, default routes learned from RIP neighbors will be deleted.Prerequisites
A RIP process has been created and the RIP view has been displayed using the rip command.
<HUAWEI> system-view [~HUAWEI] route-policy filter permit node 10 [*HUAWEI] quit [*HUAWEI] rip 100 [*HUAWEI-rip-100] default-route originate route-policy filter cost 15
<HUAWEI> system-view [~HUAWEI] rip 100 [*HUAWEI-rip-100] default-route originate cost 2