OcNOS-SP : Layer 3 Guide : Border Gateway Protocol Command Reference : BGP Commands : neighbor weight
neighbor weight
Use this command to specify a weight value, per address-family, for all routes learned from a neighbor.
The route with the highest weight gets preference when the same prefix is learned from more than one peer. Unlike the local-preference attribute, the weight attribute is relevant only to the local router. The weights assigned using the set weight command override the weights assigned using this command.
Use this command in router mode to specify a weight value for all address families. Use this command in address family mode to specify a weight value per IPv4/IPv6/VPNv4/6PE address family,
When the weight is set for a peer group, all members of the peer group get the same weight. This command can also be used to assign a different weight to an individual peer-group member. When an individually-configured weight of a peer-group member is removed, its weight is reset to its peer group’s weight.
Use the no parameter with this command to remove a weight assignment.
Command Syntax
neighbor (A.B.C.D|X:X::X:X|WORD) weight <0-65535>
no neighbor (A.B.C.D|X:X::X:X|WORD) weight
no neighbor (A.B.C.D|X:X::X:X|WORD) weight <0-65535>
For v4-unnumbered mode:
neighbor WORD weight <0-65535>
no neighbor WORD weight
no neighbor WORD weight <0-65535>
Parameters
A.B.C.D
Address of the BGP neighbor in an IPv4 format
X:X::X:X
Address of the BGP neighbor in an IPv6 format
WORD
Name of a BGP peer group created with the neighbor WORD peer-group command. When you specify this parameter, the command applies to all peers in the group.
<0-65535>
Weight value
Default
By default, neighbor weight value is 0
Command Mode
Router Address-Family mode and v4-unnumbered mode
Applicability
This command was introduced before OcNOS version 1.3.
Examples
#configure terminal
(config)#router bgp 12
(config-router)#address-family ipv4 unicast
(config-router-af)#neighbor 10.10.10.10 weight 60
 
(config-router-af)#no neighbor 10.10.10.10 weight 60
For unnumbered peer, IPv4 unicast mode commands are configured under v4-unnumbered-mode.
(config)#router bgp 100
(config-router)#address-family ipv4 unicast
(config-router-af)#bgp v4-unnumbered-mode
(config-router-v4-unnum)#neighbor eth1 weight 44
Last modified date: 10/16/2023