module openconfig-vlan { yang-version 1; namespace "http://openconfig.net/yang/vlan"; prefix oc-vlan; import openconfig-vlan-types { prefix oc-vlan-types; } import openconfig-interfaces { prefix oc-if; } import openconfig-if-ethernet { prefix oc-eth; } import openconfig-if-aggregate { prefix oc-lag; } import iana-if-type { prefix ianaift; } import openconfig-extensions { prefix oc-ext; } organization "OpenConfig working group"; contact "OpenConfig working group netopenconfig@googlegroups.com"; description "This module defines configuration and state variables for VLANs, in addition to VLAN parameters associated with interfaces"; revision 2021-07-28 { description "Add prefix to qualify when statements"; reference "3.2.1"; } revision 2019-04-16 { description "Update import prefix for iana-if-type module"; reference "3.2.0"; } revision 2019-01-31 { description "Revise QinQ matching and add input/output VLAN stack operations."; reference "3.1.0"; } revision 2018-11-21 { description "Add OpenConfig module metadata extensions."; reference "3.0.2"; } revision 2018-06-05 { description "Fix bugs in when statements."; reference "3.0.1"; } revision 2018-02-14 { description "Fix bug with name of 802.1ad identity."; reference "3.0.0"; } revision 2017-07-14 { description "Move top-level vlan data to network-instance; Update identities to comply to style guide; fixed pattern quoting; corrected trunk vlan types; added TPID config to base interface."; reference "2.0.0"; } revision 2016-05-26 { description "OpenConfig public release"; reference "1.0.2"; } oc-ext:openconfig-version "3.2.1"; oc-ext:regexp-posix; oc-ext:catalog-organization "openconfig"; oc-ext:origin "openconfig"; grouping vlan-config { description "VLAN configuration container."; leaf vlan-id { type oc-vlan-types:vlan-id; description "Interface VLAN id."; } leaf name { type string; description "Interface VLAN name."; } leaf status { type enumeration { enum "ACTIVE" { description "VLAN is active"; } enum "SUSPENDED" { description "VLAN is inactive / suspended"; } } default "ACTIVE"; description "Admin state of the VLAN"; } } grouping vlan-state { description "State variables for VLANs"; } grouping vlan-tpid-config { description "TPID configuration for dot1q-enabled interfaces"; leaf tpid { type identityref { base oc-vlan-types:TPID_TYPES; } default "oc-vlan-types:TPID_0X8100"; description "Optionally set the tag protocol identifier field (TPID) that is accepted on the VLAN"; } } grouping vlan-tpid-state { description "TPID opstate for dot1q-enabled interfaces"; } grouping vlan-members-state { description "List of interfaces / subinterfaces belonging to the VLAN."; container members { description "Enclosing container for list of member interfaces"; list member { config false; description "List of references to interfaces / subinterfaces associated with the VLAN."; uses oc-if:base-interface-ref-state; } } } grouping vlan-switched-config { description "VLAN related configuration that is part of the physical Ethernet interface."; leaf interface-mode { type oc-vlan-types:vlan-mode-type; description "Set the interface to access or trunk mode for VLANs"; } leaf native-vlan { when "../interface-mode = 'oc-vlan-types:TRUNK'" { description "Native VLAN is valid for trunk mode interfaces"; } type oc-vlan-types:vlan-id; description "Set the native VLAN id for untagged frames arriving on a trunk interface. Tagged frames sent on an interface configured with a native VLAN should have their tags stripped prior to transmission. This configuration is only valid on a trunk interface."; } leaf access-vlan { when "../interface-mode = 'oc-vlan-types:ACCESS'" { description "Access VLAN assigned to the interfaces"; } type oc-vlan-types:vlan-id; description "Assign the access vlan to the access port."; } leaf-list trunk-vlans { when "../interface-mode = 'oc-vlan-types:TRUNK'" { description "Allowed VLANs may be specified for trunk mode interfaces."; } type union { type oc-vlan-types:vlan-id; type oc-vlan-types:vlan-range; } description "Specify VLANs, or ranges thereof, that the interface may carry when in trunk mode. If not specified, all VLANs are allowed on the interface. Ranges are specified in the form x..y, where x