83
Setting OSPF preference
A router can run multiple routing protocols, and each protocol is assigned a preference. If multiple
routes are available to the same destination, the one with the highest protocol preference is selected
as the best route.
To set OSPF preference:
1. Enter system view.
system-view
N/A
2. Enter OSPF view.
ospf
[
process-id |
router-id
router-id
|
vpn-instance
vpn-instance-name ]
*
N/A
3. Set a preference for
OSPF.
preference
[
ase
] { preference |
route-policy
route-policy-name } *
By default, the preference of OSPF
internal routes is 10 and the preference
of OSPF external routes is 150.
Configuring discard routes for summary networks
Perform this task on an ABR or ASBR to specify whether to generate discard routes for summary
networks. You can also specify a preference for the discard routes.
1. Enter system view.
system-view
N/A
2. Enter OSPF view.
ospf
[
process-id |
router-id
router-id |
vpn-instance
vpn-instance-name ] *
N/A
3. Configure discard routes
for summary networks.
discard-route
{
external
{ preference |
suppression
} |
internal
{ preference |
suppression
} } *
By default:
• The ABR or ASBR generates
discard routes for summary
networks.
• The preference of discard
routes is 255.
Configuring OSPF route redistribution
On a router running OSPF and other routing protocols, you can configure OSPF to redistribute static
routes, direct routes, or routes from other protocols, such as RIP, IS-IS, and BGP. OSPF advertises
the routes in Type-5 LSAs or Type-7 LSAs. In addition, you can configure OSPF to filter redistributed
routes so that OSPF advertises only permitted routes.
import-route bgp command redistributes only EBGP routes. Because the import-route bgp
-ibgp
command redistributes both EBGP and IBGP routes, and might cause routing loops, use
it with caution.
Redistributing routes from another routing protocol
1. Enter system view.
N/A