set protocols ospf max-metric router-lsa on-startup


The set protocols ospf max-metric router-lsa on-startup command configures the OSPF protocol to advertise a maximum metric (65535) so that other routers do not prefer this router as an intermediate hop in their shortest path first (SPF) calculations. The parameter on-startup <advert-time> indicates to advertise a maximum metric from the time the OSPF neighbor is established for the advert-time configured in seconds.

The delete protocols ospf max-metric router-lsa on-startup command advertises the normal cost metrics instead of advertising the maximized cost metric. This setting causes the router to be considered in traffic forwarding.

NOTE:

max-metric router-lsa feature has three configuration methods, the commands are shown as below.

set protocols ospf [vrf <vrf-name>] max-metric router-lsa on-startup <advert-time>

set protocols ospf [vrf <vrf-name>] max-metric router-lsa on-shutdown <advert-time>

set protocols ospf [vrf <vrf-name>] max-metric router-lsa administrative

They can be configured separately or simultaneously. When administrative is configured with other methods, the configuration of “administrative takes effect.


Command Syntax

set protocols ospf [vrf <vrf-name>] max-metric router-lsa on-startup <advert-time>

delete protocols ospf [vrf <vrf-name>] max-metric router-lsa on-startup


Parameters

Parameter

Description

vrf <vrf-name>

Optional. Specifies a VRF name. The value is a string. It’s a user-defined VRF set by the command set ip vrf <vrf-name> [description <string>].

on-startup <advert-time>

Specifies the time interval to advertise a maximum metric from the time the OSPF neighbor is established. The value is an integer, in seconds, that ranges from 5 to 86400.


Usage Guidelines

This command is mainly used in the following scenarios:

  1. When a new router is added to the OSPF network, but don’t want to participate in data forwarding immediately. Then, max-metric router-lsa on-startup can be configured to establish the adjacency relationship and converge the network normally, while won’t become an alternative path for other existing OSPF paths.
  2. When a router is about to be disconnected from the network, to avoid neighbors from failing to detect it and causing a routing black hole, the max-metric router-lsa on-shutdown can be configured to enable the neighbors to recalculate the path before shutting down the router, and the data will no longer be forwarded through the router.

After the configuration on-startup <advert-time> is set, OSPF uses the maximum metric (65535) in the advertising LSA (Link State Advertisement) for the configured <advert-time> time when OSPF neighbor is established.

The highlighted lines in the following example shows that set protocols ospf [vrf <vrf-name>] max-metric router-lsa on-startup <advert-time> is configured with 300 seconds, and 3 minutes 39 seconds remaining is left for advertising the maximum metric.

admin@Xorplus# set protocols ospf vrf x max-metric router-lsa on-startup 300

admin@Xorplus# commit

 

admin@Xorplus# run show ospf vrf x

VRF Name: x

OSPF Routing Process, Router ID: 10.1.240.0

Supports only single TOS (TOS0) routes

This implementation conforms to RFC2328

RFC1583Compatibility flag is disabled

OpaqueCapability flag is disabled

Stub router advertisement is configured

   Enabled for 300s after start-up

Initial SPF scheduling delay 0 millisec(s)

Minimum hold time between consecutive SPFs 50 millisec(s)

Maximum hold time between consecutive SPFs 5000 millisec(s)

Hold time multiplier is currently 2

SPF algorithm last executed 1m06s ago

Last SPF duration 95 usecs

SPF timer is inactive

LSA minimum interval 5000 msecs

LSA minimum arrival 1000 msecs

Write Multiplier set to 20

 Refresh timer 10 secs

Maximum multiple paths(ECMP) supported  256

This router is an ASBR (injecting external routing information)

Number of external LSA 2. Checksum Sum 0x0000fc5c

Number of opaque AS LSA 0. Checksum Sum 0x00000000

Number of areas attached to this router: 1

Area ID: 0.0.0.0 (Backbone)

   Number of interfaces in this area: Total: 11, Active: 10

   Originating stub / maximum-distance Router-LSA

     Active from startup, 3m39s remaining

Number of fully adjacent neighbors in this area: 1

   Area has no authentication

   SPF algorithm executed 6 times

   Number of LSA 5

   Number of router LSA 3. Checksum Sum 0x00013649

   Number of network LSA 2. Checksum Sum 0x0000f3a3

   Number of summary LSA 0. Checksum Sum 0x00000000

   Number of ASBR summary LSA 0. Checksum Sum 0x00000000

   Number of NSSA LSA 0. Checksum Sum 0x00000000

   Number of opaque link LSA 0. Checksum Sum 0x00000000

   Number of opaque area LSA 0. Checksum Sum 0x00000000


Example

  • Setting to maximize the cost metrics for Router LSA on startup:
admin@Xorplus# set protocols ospf max-metric router-lsa on-startup 300
admin@Xorplus# commit

Copyright © 2024 Pica8 Inc. All Rights Reserved.