module ietf-if-l3-vlan {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-if-l3-vlan";
prefix if-l3-vlan;
import ietf-interfaces {
prefix if;
}
import iana-if-type {
prefix ianaift;
}
import ieee802-dot1q-types {
prefix dot1q-types;
}
import ietf-interfaces-common {
prefix if-cmn;
}
organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group";
contact
"WG Web:
WG List:
WG Chair: Lou Berger
WG Chair: Joel Jaeggli
WG Chair: Kent Watsen
Editor: Robert Wilton
";
description
"This YANG module models L3 VLAN sub-interfaces";
revision 2019-03-05 {
description "Latest draft revision";
reference
"Internet-Draft draft-ietf-netmod-sub-intf-vlan-model-05";
}
/*
* Add support for the 802.1Q VLAN encapsulation syntax on layer 3
* terminated VLAN sub-interfaces.
*/
augment "/if:interfaces/if:interface/if-cmn:encapsulation/" +
"if-cmn:encaps-type" {
when
"derived-from-or-self(../if:type,
'ianaift:ethernetCsmacd') or
derived-from-or-self(../if:type,
'ianaift:ieee8023adLag') or
derived-from-or-self(../if:type,
'if-cmn:ethSubInterface')" {
description
"Applies only to Ethernet-like interfaces and
sub-interfaces";
}
description
"Augment the generic interface encapsulation with an
basic 802.1Q VLAN encapsulation for sub-interfaces.";
/*
* Matches a single VLAN Id, or a pair of VLAN Ids to classify
* traffic into an L3 service.
*/
case dot1q-vlan {
container dot1q-vlan {
must
'count(../../if-cmn:forwarding-mode) = 0 or ' +
'derived-from-or-self(../../if-cmn:forwarding-mode,' +
'"if-cmn:layer-3-forwarding")' {
error-message
"If the interface forwarding-mode leaf is set then it
must be set to an identity that derives from
layer-3-forwarding";
description
"The forwarding-mode leaf on an interface can
optionally be used to enforce consistency of
configuration";
}
description
"Match VLAN tagged frames with specific VLAN Ids";
container outer-tag {
must
'tag-type = "dot1q-types:s-vlan" or ' +
'tag-type = "dot1q-types:c-vlan"' {
error-message
"Only C-VLAN and S-VLAN tags can be matched";
description
"For IEEE 802.1Q interoperability, only C-VLAN and
S-VLAN tags can be matched";
}
description
"Classifies traffic using the outermost VLAN tag on the
frame.";
uses dot1q-types:dot1q-tag-classifier-grouping;
}
container second-tag {
must
'../outer-tag/tag-type = "dot1q-types:s-vlan" and ' +
'tag-type = "dot1q-types:c-vlan"' {
error-message
"When matching two tags, the outermost tag must be
specified and of S-VLAN type and the second outermost
tag must be of C-VLAN tag type";
description
"For IEEE 802.1Q interoperability, when matching two
tags, it is required that the outermost tag exists and
is an S-VLAN, and the second outermost tag is a
C-VLAN";
}
presence "Also classify on the second outermost VLAN tag";
description
"Classifies traffic using the second outermost VLAN tag
on the frame.";
uses dot1q-types:dot1q-tag-classifier-grouping;
}
}
}
}
}