121
Routers on the network cannot find neighbors through broadcasting hello packets, so you must specify
neighbors and neighbor DR priorities on the routers.
After startup, a router sends a hello packet to neighbors with DR priorities higher than 0. When the DR
and BDR are elected, the DR will send hello packets to all neighbors for adjacency establishment.
The cost set with the
peer
command applies only to P2MP neighbors. If no cost is specified, the cost to
the neighbor equals the local interface's cost.
A router uses the priority set with the
peer
command to determine whether to send a hello packet to the
neighbor rather than for DR election. The DR priority set with the
ospf dr-priority
command is used for DR
election.
Examples
# Specify the neighbor 1.1.1.1.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] peer 1.1.1.1
Related commands
ospf dr-priority
preference
Use
preference
to set a preference for OSPF.
Use
undo preference
to restore the default.
Syntax
preference
[
ase
] [
route-policy
route-policy-name
]
value
undo preference
[
ase
]
Default
The preference is 10 for OSPF internal routes and 150 for OSPF external routes (or ASE routes).
Views
OSPF view
Predefined user roles
network-admin
Parameters
ase
: Sets a preference for OSPF external routes. Without this keyword, the command sets a preference
for OSPF internal routes.
route-policy
route-policy-name
: Specifies a routing policy by its name, a case-sensitive string of 1 to 63
characters, to set a preference for the specified routes.
value
: Specifies the preference value in the range of 1 to 255. The smaller the value, the higher the
preference.
Usage guidelines
If multiple routing protocols find routes to the same destination, the router uses the route found by the
protocol with the highest preference.