Repository navigation
Add support for ospf auto cost configuration - #1693
Merged
Merged
Conversation
troglobit
requested changes
Oct 8, 2026
troglobit
left a comment
Contributor
There was a problem hiding this comment.
Minor comments, mostly for internal discussion.
saba8814
force-pushed
the
add-support-for-ospf-auto-cost-configuration
branch
3 times, most recently
from
October 8, 2026 16:06
22355ea to
a46aefa
Compare
jovatn
reviewed
Oct 13, 2026
jovatn
left a comment
Contributor
There was a problem hiding this comment.
Slight changes to the documentation is suggested.
Also, can we take a look at the YANG changes to auto-cost (agnostic to OSPFv2 or OSPFv3?) and the location of its documentation (under OSPFv2).
All routers in an OSPF domain must use the same reference bandwidth to agree on link costs, and other vendors default to other values than Frr. Until now the value was fixed at the Frr default. Enable the ietf-ospf auto-cost feature for OSPFv2 and OSPFv3. The reference-bandwidth leaf defaults to 100000 Mbit/s, the value used so far, so link costs do not change on upgrade and no migration is needed. Frr can not turn auto-cost off, so the enabled leaf defaults to true and false is rejected. Resolves: #1576 Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
To check that the reference bandwidth matches across the domain it has to be readable. Frr has no JSON for it, so read it from the daemon's running-config, which lists it only when it differs from the default. Report it for OSPFv2 and OSPFv3, and show it in 'show ip ospf' and 'show ipv6 ospf'. Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
Verify that the interface cost follows the reference bandwidth, for OSPFv2 and OSPFv3. The expected cost is derived from the link speed, so the test works on hardware and on virtual links of unknown speed. On a 1 Gbit/s link the reference bandwidths 100000, 10000 and 1000 Mbit/s give the costs 100, 10 and 1. Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
saba8814
force-pushed
the
add-support-for-ospf-auto-cost-configuration
branch
2 times, most recently
from
October 13, 2026 12:14
b205faa to
4bdbb34
Compare
Explain why the reference bandwidth must match across the domain, how the interface cost is calculated, and where to read the value. Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
saba8814
force-pushed
the
add-support-for-ospf-auto-cost-configuration
branch
from
October 13, 2026 12:16
4bdbb34 to
7b5c82a
Compare
Contributor
|
LGTM! |
troglobit
approved these changes
Oct 13, 2026
Contributor
Yeah me too, approved the PR for merge! @jovatn we should probably create a doc-task to "consolidate and refactor" routing-dokumentationen. Kan du lägga upp ett? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
All OSPF routers in a domain need the same auto-cost reference bandwidth
to agree on link costs. Other vendors use other defaults than Frr, so
the value has to be configurable. Resolves #1576.
The
auto-costcontainer from ietf-ospf is now supported, for OSPFv2and OSPFv3:
reference-bandwidthdefaults to 100000 Mbit/s, the Frr default usedso far. Link costs do not change on upgrade, so no migration script
is needed.
enabledis always true. Frr has no way to turn auto-cost off, sosetting it to false is rejected. An explicit interface
coststilloverrides the calculated one.
shown by
show ip ospfandshow ipv6 ospf.The new test
ospf_auto_costruns for both OSPF versions. It sets thereference bandwidth on both routers and checks the interface cost. On
a 1 Gbit/s link, 100000, 10000 and 1000 Mbit/s give the costs 100, 10
and 1.
Checklist
Tick relevant boxes, this PR is-a or has-a: