CLI Guide

Table Of Contents
Layer 3 Routing Commands 1278
Syntax
distance distance [ prefix wildcard-mask [prefix-list] ]
no distance distance [ prefix wildcard-mask [prefix-list] ]
distance—The preference value for matching routes. The range is 1 to 255.
prefix wildcard-mask— Routes learned from BGP peers whose address falls
within this prefix are assigned the configured distance value. The wildcard-
mask is an inverted network mask whose 1 bits indicate the don’t care
portion of the prefix.
prefix-list—A prefix list can optionally be specified to limit the distance
value to a specific set of destination prefixes learned from matching
neighbors.
Default Configuration
BGP assigns preference values according to the distance bgp command,
unless overridden for specific neighbors or prefixes by this command.
Command Mode
BGP Router Configuration mode
User Guidelines
You may enter up to 128 instances of this command. Two instances of this
command may not have the same prefix and wildcard mask. If a distance
command is configured that matches an existing distance command’s prefix
and wildcard mask, the new command replaces the existing command. There
can be overlap between the prefix and mask configured for different
commands. When there is overlap, the command whose prefix and wildcard
mask are the longest match for a neighbor’s address is applied to routes from
that neighbor.
An ECMP route’s distance is determined by applying distance commands to
the neighbor that provided the best path.
The distance command is not applied to existing routes. To apply
configuration changes to the distance command itself or the prefix list to
which a distance command applies, you must force a hard reset of affected
neighbors.