The default-route originate command configures RIP to originate a default route or advertise the default route in the routing table to neighbors.
The undo default-route originate command restores the default configuration.
By default, the device does not advertise the default route to neighbors.
default-route originate [ cost cost | { match default | route-policy route-policy-name } [ avoid-learning ] ]*
undo default-route originate
Parameter | Description | Value |
---|---|---|
cost cost | Specifies the metric of the default route. | The value is an integer that ranges from 0 to 15. The default value is 0. |
match default | Indicates that the device advertises the default route imported from another routing protocol or RIP process in the routing table to neighbors. | - |
avoid-learning | Disables RIP from importing default routes. If a default route in active state already exists in the routing table, the default route is set to inactive after this parameter is used. | - |
route-policy route-policy-name | Specifies the name of the routing policy. RIP will originate the default route only if route permitted by the route policy is present as active in the routing table. | The name is a string of 1 to 40 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
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 switch, the switch 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 switch 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.