Skip to content

Conversation

@Dan-Dev-Net
Copy link
Contributor

@Dan-Dev-Net Dan-Dev-Net commented Nov 7, 2025

Related Issues

Fixes #507

Changes

Router-Level OSPF Attributes

Log Adjacency Changes:

  • log_adjacency_changes - Log changes in adjacency state (choice option)
  • log_adjacency_changes_detail - Log changes with detail (mutually exclusive with above)

NSF (Non-Stop Forwarding):

  • nsf_cisco - Enable Cisco NSF (choice option)
  • nsf_cisco_enforce_global - Enforce global NSF neighbors
  • nsf_ietf - Enable IETF graceful restart (mutually exclusive with cisco)
  • nsf_ietf_restart_interval - Restart interval in seconds (1-3600)

Max-Metric Router LSA:

  • max_metric_router_lsa - Set maximum metric temporarily
  • max_metric_router_lsa_summary_lsa_metric - Summary LSA metric (1-16777215)
  • max_metric_router_lsa_external_lsa_metric - External LSA metric (1-16777215)
  • max_metric_router_lsa_include_stub - Include stub networks
  • max_metric_router_lsa_on_startup_time - Duration in seconds (5-86400)
  • max_metric_router_lsa_on_startup_wait_for_bgp - Wait for BGP (mutually exclusive with time)

Fast-Reroute:

  • fast_reroute_per_prefix_enable_prefix_priority - Priority of prefixes to protect (high/low)
    • Note: Requires network-advantage license
    • Note: Non-VRF only (not available in ospf_vrf resource)

Redistribute:

  • redistribute_static_subnets - Redistribute static routes with subnets
  • redistribute_connected_subnets - Redistribute connected routes with subnets

Interface-Level OSPF Attributes (1 attribute)

Multi-Area:

  • multi_area_ids - List of additional OSPF area IDs for multi-homing
    • Supports both decimal (0-4294967295) and IPv4 address format

YANG Model Details

Choice Structures Handled

  • log-adjacency-changes-choice - Base vs detail logging
  • nsf-cisco-ietf - Cisco NSF vs IETF graceful restart
  • time-wait-for-bgp-choice - Time-based vs BGP-triggered max-metric

Presence Containers

  • nsf-cisco, nsf-ietf - Enabled when present
  • router-lsa - Max-metric configuration container

Union Types

  • area-id in multi-area - Accepts uint32 or ipv4-address

Version Compatibility

YANG Version Analysis Performed:

  • ✅ All features verified to exist in IOS-XE 17.12.1 YANG model
  • ✅ All features verified to exist in IOS-XE 17.15.1 YANG model
  • No test_tags required - Features compatible with all pipeline test devices

Analysis documented in: EPIC-510-ospf_advanced_support/YANG-VERSION-COMPATIBILITY.md

Testing

Direct Provider Testing

  • Provider build successful (make gen + go build)
  • Terraform init/plan/apply successful
  • Device configuration verified via CLI
  • Idempotency confirmed (no changes on second apply)
  • Terraform destroy successful

Device Testing Details

  • Device: Cat8kv at 10.81.239.57
  • IOS-XE Version: 17.15.1a
  • License: network-advantage (required for fast-reroute)

Configuration Verified on Device

router ospf 100
 max-metric router-lsa include-stub summary-lsa 16711680 external-lsa 16711680 on-startup 60
 nsf cisco enforce global
 fast-reroute per-prefix enable prefix-priority high
 redistribute connected
 redistribute static
 log-adjacency-changes

Test Files (Not Committed)

  • Local testing performed with test-ospf-epic510.tf
  • Test files excluded from PR per project standards

Key Implementation Notes

VRF Limitations

  • fast-reroute is not available in VRF OSPF per YANG model
  • Only included in ospf.yaml, excluded from ospf_vrf.yaml
  • Module implementation reflects this limitation

License Requirements

  • fast-reroute requires network-advantage license
  • Feature not visible on devices with network-essentials license
  • Documented in testing results

Default Value Behavior

  • log-adjacency-changes defaults to true in IOS-XE
  • Appears in show run all but not in show run
  • Provider correctly manages this default

Files Modified

Definition Files (3)

  • gen/definitions/ospf.yaml - Added 17 router-level attributes
  • gen/definitions/ospf_vrf.yaml - Added VRF-compatible attributes (no fast-reroute)
  • gen/definitions/interface_ospf.yaml - Added multi-area support

Generated Files (24)

  • Resource/Data source files for ospf, ospf_vrf, interface_ospf
  • Model files
  • Test files
  • Documentation and examples

Breaking Changes

None. All new attributes are optional.

Documentation

Comprehensive documentation created in EPIC-510-ospf_advanced_support/:

  • YANG-EXPLORATION-NOTES.md - Complete YANG analysis
  • CLI-VERIFICATION-RESULTS.md - Device testing results
  • YANG-VERSION-COMPATIBILITY.md - Version compatibility analysis
  • PROVIDER-TEST-RESULTS.md - Testing evidence
  • PROVIDER-PHASE-COMPLETE.md - Phase summary

Additional Notes

  • Implementation follows established patterns from previous Epics
  • All YANG paths verified in YANG Suite
  • CLI behavior validated on live devices
  • Version compatibility ensures pipeline success
  • Ready for schema and module implementation

This PR implements advanced OSPF configuration features for the IOS-XE provider, adding support for log-adjacency-changes, NSF (Non-Stop Forwarding), max-metric router-lsa, fast-reroute, redistribute options, and multi-area interface configurations.

- Add log-adjacency-changes and log-adjacency-changes-detail (choice pattern)
- Add NSF cisco and ietf support with enforce global and restart-interval
- Add max-metric router-lsa with summary/external LSA metrics and on-startup options
- Add fast-reroute per-prefix with prefix-priority (non-VRF only)
- Add redistribute static/connected subnets options
- Add interface multi-area support for multi-homing

Implements Epic #510
Tested on IOS-XE 17.15.1a
Compatible with IOS-XE 17.12.1 and 17.15.x (no test_tags required)
@danischm danischm merged commit 75c5c1a into CiscoDevNet:main Nov 9, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants