module ietf-ospf-admin-tags {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-ospf-admin-tags";
prefix ospf-admin-tags;
import ietf-routing {
prefix rt;
reference
"RFC 8349: A YANG Data Model for Routing
Management (NMDA Version)";
}
import ietf-ospf {
prefix ospf;
reference
"RFC 9129: YANG Data Model for the OSPF Protocol";
}
import ietf-inet-types {
prefix inet;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-ospfv3-extended-lsa {
prefix ospfv3-e-lsa;
reference
"RFC 9587: YANG Data Model for OSPFv3 Extended Link
State Advertisements (LSAs)";
}
organization
"IETF LSR - Link State Routing Working Group";
contact
"WG Web:
WG List:
Author: Yingzhen Qu
Author: Acee Lindem
Author: Peter Psenak
";
description
"This YANG module defines the configuration
and operational state for OSPF administrative tags.
This YANG data model conforms to the Network Management
Datastore Architecture (NMDA) as described in RFC 8342.
Copyright (c) 2025 IETF Trust and the persons identified as
authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject to
the license terms contained in, the Revised BSD License set
forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC 9825;
see the RFC itself for full legal notices.";
reference
"RFC 9825: Extensions to OSPF for Advertising Prefix
Administrative Tags.";
revision 2025-07-31 {
description
"Initial revision.";
reference
"RFC 9825: Extensions to OSPF for Advertising Prefix
Administrative Tags.";
}
grouping prefix-admin-tag-sub-tlv {
description
"Prefix Administrative Tag Sub-TLVs.";
container prefix-admin-tag-sub-tlv {
config false;
description
"Prefix Administrative Tag Sub-TLV.";
leaf-list admin-tag {
type uint32;
description
"Administrative tags.";
}
}
}
/* Configuration */
augment "/rt:routing/rt:control-plane-protocols"
+ "/rt:control-plane-protocol/ospf:ospf"
+ "/ospf:areas/ospf:area/ospf:ranges/ospf:range" {
when "derived-from-or-self(../../../../.."
+ "/rt:type, 'ospf:ospf')" {
description
"This augments the OSPF routing protocol area range
configuration.";
}
description
"This augments the OSPF protocol area range configuration
with administrative tags. The configured tags will be
advertised with summary prefix when it is active.";
container admin-tags {
when "../ospf:advertise = 'true'";
leaf-list admin-tag {
type uint32;
description
"Administrative tags.";
}
description
"OSPF prefix administrative tags.";
}
}
augment "/rt:routing/rt:control-plane-protocols"
+ "/rt:control-plane-protocol/ospf:ospf"
+ "/ospf:areas/ospf:area/ospf:interfaces/ospf:interface" {
when "derived-from-or-self(../../../../.."
+ "/rt:type, 'ospf:ospf')" {
description
"This augments the OSPF routing protocol interface
configuration.";
}
description
"This augments the OSPF protocol interface configuration
with Administrative Tags. The configured tags will be
advertised with local prefixes configured for the interface.";
container local-prefix-admin-tags {
leaf-list default-admin-tag {
type uint32;
description
"Administrative tags that will be associated with
local prefixes if the prefix is not specified explicitly.
If omitted, no administrative tags are associated with
local prefixes by default.";
}
list specific-prefix-admin-tag {
key "prefix";
leaf prefix {
type inet:ip-prefix;
description
"IPv4 or IPv6 prefix.";
}
leaf-list admin-tag {
type uint32;
description
"Administrative tags that will be associated with
the specified local prefix. If omitted, no
administrative tags are associated with the specified
local prefix.";
}
description
"Administrative tags that are explicitly associated with
the specified prefix.";
}
description
"List of administrative tags that are to be advertised
with interface local prefixes.";
}
}
/* Local-RIB */
augment "/rt:routing"
+ "/rt:control-plane-protocols/rt:control-plane-protocol"
+ "/ospf:ospf/ospf:local-rib/ospf:route/ospf:next-hops"
+ "/ospf:next-hop" {
description
"This augments local-rib next-hop with administrative tags.";
leaf-list admin-tag {
type uint32;
description
"Administrative tags.";
}
}
/* Database */
augment "/rt:routing"
+ "/rt:control-plane-protocols/rt:control-plane-protocol"
+ "/ospf:ospf/ospf:areas/ospf:area"
+ "/ospf:interfaces/ospf:interface/ospf:database"
+ "/ospf:link-scope-lsa-type/ospf:link-scope-lsas"
+ "/ospf:link-scope-lsa/ospf:version/ospf:ospfv2"
+ "/ospf:ospfv2/ospf:body/ospf:opaque"
+ "/ospf:extended-prefix-opaque/ospf:extended-prefix-tlv" {
when "derived-from-or-self(../../../../../../../../../.."
+ "/../../../../rt:type, 'ospf:ospfv2')" {
description
"This augmentation is only valid for OSPFv2.";
}
description
"Prefix Administrative Tag Sub-TLVs for OSPFv2 extended prefix
TLV in type 9 opaque LSA.";
uses prefix-admin-tag-sub-tlv;
}
augment "/rt:routing"
+ "/rt:control-plane-protocols/rt:control-plane-protocol"
+ "/ospf:ospf/ospf:areas"
+ "/ospf:area/ospf:database"
+ "/ospf:area-scope-lsa-type/ospf:area-scope-lsas"
+ "/ospf:area-scope-lsa/ospf:version/ospf:ospfv2"
+ "/ospf:ospfv2/ospf:body/ospf:opaque"
+ "/ospf:extended-prefix-opaque/ospf:extended-prefix-tlv" {
when "derived-from-or-self(../../../../../../../../../.."
+ "/../../rt:type, 'ospf:ospfv2')" {
description
"This augmentation is only valid for OSPFv2.";
}
description
"Prefix Administrative Tag Sub-TLVs for OSPFv2 extended prefix
TLV in type 10 opaque LSA.";
uses prefix-admin-tag-sub-tlv;
}
augment "/rt:routing"
+ "/rt:control-plane-protocols/rt:control-plane-protocol"
+ "/ospf:ospf/ospf:database"
+ "/ospf:as-scope-lsa-type/ospf:as-scope-lsas"
+ "/ospf:as-scope-lsa/ospf:version/ospf:ospfv2"
+ "/ospf:ospfv2/ospf:body/ospf:opaque"
+ "/ospf:extended-prefix-opaque/ospf:extended-prefix-tlv" {
when "derived-from-or-self(../../../../../../../.."
+ "/../../rt:type, 'ospf:ospfv2')" {
description
"This augmentation is only valid for OSPFv2.";
}
description
"Prefix Administrative Tag Sub-TLVs for OSPFv2 extended prefix
TLV in type 11 opaque LSA.";
uses prefix-admin-tag-sub-tlv;
}
augment "/rt:routing"
+ "/rt:control-plane-protocols/rt:control-plane-protocol"
+ "/ospf:ospf/ospf:areas/ospf:area/ospf:database"
+ "/ospf:area-scope-lsa-type/ospf:area-scope-lsas"
+ "/ospf:area-scope-lsa/ospf:version/ospf:ospfv3"
+ "/ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-inter-area-prefix"
+ "/ospfv3-e-lsa:e-inter-prefix-tlvs"
+ "/ospfv3-e-lsa:inter-prefix-tlv" {
when "derived-from-or-self(../../../../../../../../../.."
+ "/../../rt:type, 'ospf:ospfv3')" {
description
"This augmentation is only valid for OSPFv3.";
}
description
"Augment OSPFv3 Inter-Area-Prefix TLV in the
E-Inter-Area-Prefix-LSA.";
uses prefix-admin-tag-sub-tlv;
}
augment "/rt:routing"
+ "/rt:control-plane-protocols/rt:control-plane-protocol"
+ "/ospf:ospf/ospf:areas/ospf:area/ospf:database"
+ "/ospf:area-scope-lsa-type/ospf:area-scope-lsas"
+ "/ospf:area-scope-lsa/ospf:version/ospf:ospfv3"
+ "/ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-intra-area-prefix"
+ "/ospfv3-e-lsa:e-intra-prefix-tlvs"
+ "/ospfv3-e-lsa:intra-prefix-tlv" {
when "/rt:routing/rt:control-plane-protocols"
+ "/rt:control-plane-protocol/rt:type = 'ospf:ospfv3'" {
description
"This augmentation is only valid for OSPFv3.";
}
description
"Augment OSPFv3 Intra-Area-Prefix TLV in the
E-Intra-Area-Prefix-LSA.";
uses prefix-admin-tag-sub-tlv;
}
augment "/rt:routing"
+ "/rt:control-plane-protocols/rt:control-plane-protocol"
+ "/ospf:ospf/ospf:database"
+ "/ospf:as-scope-lsa-type/ospf:as-scope-lsas"
+ "/ospf:as-scope-lsa/ospf:version/ospf:ospfv3"
+ "/ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-as-external"
+ "/ospfv3-e-lsa:e-external-tlvs"
+ "/ospfv3-e-lsa:external-prefix-tlv" {
when "derived-from-or-self(../../../../../../../.."
+ "/../../rt:type, 'ospf:ospfv3')" {
description
"This augmentation is only valid for OSPFv3.";
}
description
"Augment OSPFv3 External-Prefix TLV in the E-AS-External-LSA.";
uses prefix-admin-tag-sub-tlv;
}
augment "/rt:routing"
+ "/rt:control-plane-protocols/rt:control-plane-protocol"
+ "/ospf:ospf/ospf:areas/ospf:area/ospf:database"
+ "/ospf:area-scope-lsa-type/ospf:area-scope-lsas"
+ "/ospf:area-scope-lsa/ospf:version/ospf:ospfv3"
+ "/ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-nssa"
+ "/ospfv3-e-lsa:e-external-tlvs"
+ "/ospfv3-e-lsa:external-prefix-tlv" {
when "/rt:routing/rt:control-plane-protocols"
+ "/rt:control-plane-protocol/rt:type = 'ospf:ospfv3'" {
description
"This augmentation is only valid for OSPFv3.";
}
description
"Augment OSPFv3 External-Prefix TLV in the E-NSSA-LSA.";
uses prefix-admin-tag-sub-tlv;
}
}