The rip metricin command sets the metric that is added to the route when an interface receives a RIP packet.
The undo rip metricin command restores the additional metric to the default value.
By default, there is no metric added to the route when an interface receives a RIP packet.
rip metricin { value | { acl-number | acl-name acl-name | ip-prefix ip-prefix-name } value1 }
undo rip metricin
Parameter | Description | Value |
---|---|---|
value | Specifies the metric that is added to the received route. | The value is an integer ranging from 0 to 15. By default, it is 0. |
acl-number | Specifies the basic ACL number. | The value is an integer ranging from 2000 to 2999. |
acl-name acl-name | Specifies the ACL name. | The value is a string of 1 to 64 case-sensitive characters without spaces. The value must start with a letter. |
ip-prefix ip-prefix-name | Specifies the IP prefix list. | The name is a string of 1 to 169 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
value1 | Specifies the metric that is added to the route that passes the filtering of the ACL or IP prefix list. | The value is an integer ranging from 1 to 15. |
When an interface receives a route, RIP adds the additional metric of the interface to the route, and then installs the route into the routing table. Therefore, increasing the metric of an interface also increases the metric of the RIP route received by the interface.
Adjust RIP route selection by increasing the metrics of received routes.
# Set the additional metric to 12 when VLANIF100 receives RIP routes.
<HUAWEI> system-view [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] rip metricin 12
# Set the additional metric to 12 when GE0/0/1 receives RIP routes.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] undo portswitch [HUAWEI-GigabitEthernet0/0/1] rip metricin 12
# Set the additional metric to 12 using acl-name.
<HUAWEI> system-view [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] rip metricin acl-name abcd 12
# Set the additional metric to 12 using ip-prefix.
<HUAWEI> system-view [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] rip metricin ip-prefix ip1 12