The default-route originate command configures the current FW to generate a default route and send it to neighbors, or sends a default route in its routing table to neighbors.
The undo default-route originate command deletes the default route.
By default, the current FW does not send the default route to neighbors.
default-route originate [ cost cost | tag tag | { match default | route-policy route-policy-name [ advertise-tag ] } [ avoid-learning ] ] *
undo default-route originate
| Parameter | Description | Value |
|---|---|---|
| cost cost | Specifies the cost value of the default route. | The value is an integer ranging from 0 to 15. By default, the value is 0. |
| tag tag | Specifies the tag value to be applied while advertising default route. | The value is an integer ranging from 0 to 65535. By default, the value is 0. |
| match default | Indicates that if a default route generated by another routing protocol or RIP processes exists in the routing table, this default route is advertised to neighbors. | - |
| route-policy route-policy-name | Specifies the name of a routing policy. RIP will originate the default route only if route that matches the routing policy is active in the routing table. | The value is a string of 1 to 40 case-sensitive characters and cannot contain a space. |
| advertise-tag | Specifies inherit the tag value applied through route-policy while advertising default route. | - |
| avoid-learning | Prevents a RIP process from importing default routes. If there is an active default route in the routing table, using this parameter will set the status of the default route to 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 FW, the FW 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 FW discards the packet and sends an Internet Control Message Protocol (ICMP) packet, informing the originating host that the destination address or network is unreachable.
Prerequisites
A RIP process has been created, and the RIP view is displayed using the rip command.
# Set the cost value of a default route to 2.
<FW> system-view [FW] rip 100
[FW-rip-100] default-route originate cost 2
# Set the cost value of a default route in the routing table to 2.
<FW> system-view [FW] rip 100
[FW-rip-100] default-route originate match default cost 2
# Set the current FW to originate the default route, which matches the routing policy named filter, and set the cost to 15.
<FW> system-view [FW] rip 100
[FW-rip-100] default-route originate route-policy filter cost 15
# Delete a default route.
<FW> system-view
[FW] rip 100
[FW-rip-100] undo default-route originate
# Prevent RIP from importing default routes from other routing protocols or RIP processes.
<FW> system-view [FW] rip 100
[FW-rip-100] default-route originate match default avoid-learning