set weight
Use this command to set weights for the routing table.
The weight value is used to assist in best path selection. It is assigned locally to a router. When there are several routes with a common destination, the routes with a higher weight value are preferred.
To use this command, you must first have a match clause. Match and set commands set the conditions for redistributing routes from one routing protocol to another. The match command specifies the match criteria under which redistribution is allowed for the current route-map. The set command specifies the set redistribution actions to be performed, if the match criteria are met.
Note: This command is valid only for BGP.
Use the no parameter with this command to delete an entry.
Command Syntax
set weight <0-4294967295>
no set weight (<0-4294967295>|)
Parameter
<0-4294967295>
Weight value.
Default
No default value is specified
Command Mode
Route-map mode
Applicability
This command was introduced before OcNOS version 1.3.
Examples
In the following configuration, all routes that apply to access-list 10 will have the weight set at 400. If the packets do not match any of the defined criteria, they are routed through the normal routing process.
#configure terminal
(config)#route-map rmap1 permit 3
(config-route-map)#match as-path 10
(config-route-map)#set weight 400
Last modified date: 10/16/2023