default-route originate

Function

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.

Format

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

undo default-route originate

Parameters

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.

-

Views

RIP view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
rip write

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 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.

  • 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 originates 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 originates 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 does not learn the default route advertised by RIP neighbors.

Prerequisites

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

Example

# Set the device to originate the default route which matches the route-policy named filter, and set the cost to 15.
<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
# Set the metric value 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 >