< Home

default-route originate

Function

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.

Format

default-route originate [ cost cost | { match default | route-policy route-policy-name } [ avoid-learning ] ]*

undo default-route originate

Parameters

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.

Views

RIP view

Default Level

2: Configuration level

Usage Guidelines

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.

Default routes are originated unconditionally, or based on the configured routing policy or match default. When default routes are originated based on the configuration, default routes learned from RIP neighbors will be deleted.
  • When the default-route originate command is configured without any parameter, the default route is originated unconditionally regardless of whether the default route exists in the IP routing table.
  • When the default-route originate command is configured with route-policy, RIP will originate the default route only if the route that matches route-policy is active in the IP routing table.
  • When the default-route originate command is configured with match default, RIP will originate the default route only if a default route learned by another routing protocol or RIP process is present in the IP routing table.
  • When the default-route originate command is configured with avoid-learning, RIP will not learn the default route advertised by RIP peers.

Prerequisites

A RIP process has been created, and the RIP view is displayed using the rip command.

Example

# Set the metric for the default route to 2.

<HUAWEI> system-view
[HUAWEI] rip 100
[HUAWEI-rip-100] default-route originate cost 2
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >