Skip to content

Anchor tunnel and routed-vlan under subinterfaces - #1599

Open
earies wants to merge 2 commits into
openconfig:masterfrom
earies:tun-rv-refactor
Open

earies wants to merge 2 commits into
openconfig:masterfrom
earies:tun-rv-refactor

Conversation

@earies

@earies earies commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor
  • (M) release/models/interfaces/openconfig-if-tunnel.yang
    • Add tunnel container under subinterface for interfaces of type
      tunnel
    • Deprecate interface level tunnel container, including
      tunnel/ipv4 and tunnel/ipv6
    • Increment version to 0.2.0
  • (M) release/models/vlan/openconfig-vlan.yang
    • Add routed-vlan container under subinterface for interfaces of
      type l3ipvlan
    • Deprecate interface level routed-vlan container, including
      routed-vlan/ipv4 and routed-vlan/ipv6
    • Increment version to 3.3.0

Change Scope

Per discussion in #1597 (revisiting #781) and the OC community call
(2026-11-05), this PR proposes to relocate tunnel and routed-vlan to the
same interface/subinterface pattern used by every other L3 interface in OC,
while leaving the existing paths in place.

  • subinterface/tunnel carries tunnel parameters, L3 is configured via the
    existing subinterface/ipv4|ipv6
  • subinterface/routed-vlan carries the VLAN binding, L3 (including VRRP) is
    configured via the existing subinterface/ipv4|ipv6
  • Both are gated by when on the parent interface type (tunnel and
    l3ipvlan respectively)
  • The interface level tunnel and routed-vlan containers are marked
    status deprecated so tooling flags them (not only description text)
  • Implementations w/o a native subinterface concept for these use
    subinterface index 0, same as any other flat L3 interface today

Backwards compatible - additive w/ deprecation only, no existing paths are
removed or changed.

Platform Implementations

HPE Networking: JUNOS

Tunnels and IRB are logical units of a parent interface

set interfaces fti0 unit 1 tunnel encapsulation gre source address 192.0.2.1
set interfaces fti0 unit 1 tunnel encapsulation gre destination address 192.0.2.2
set interfaces fti0 unit 1 family inet address 10.0.0.1/31
set interfaces irb unit 10 family inet address 10.10.0.1/24

Nokia: SR Linux

IRB interfaces (irbN) are subdivided into subinterfaces like any other
interface

interface irb1 {
    subinterface 1 {
        ipv4 {
            admin-state enable
            address 192.168.1.1/24 {
            }
        }
    }
}

Current vendor support of the existing paths is summarized in #1597.

Tree View

 module: openconfig-interfaces
   +--rw interfaces
      +--rw interface* [name]
         ...
         +--rw subinterfaces
         |  +--rw subinterface* [index]
         |     ...
+        |     +--rw oc-vlan:routed-vlan
+        |     |  +--rw oc-vlan:config
+        |     |  |  +--rw oc-vlan:vlan?   union
+        |     |  +--ro oc-vlan:state
+        |     |     +--ro oc-vlan:vlan?   union
         |     +--rw oc-ip:ipv4
         |     ...
         |     +--rw oc-ip:ipv6
         |     ...
+        |     +--rw oc-tun:tunnel
+        |        +--rw oc-tun:config
+        |        |  +--rw oc-tun:src?       oc-inet:ip-address
+        |        |  +--rw oc-tun:dst?       oc-inet:ip-address
+        |        |  +--rw oc-tun:ttl?       uint8
+        |        |  +--rw oc-tun:gre-key?   uint32
+        |        +--ro oc-tun:state
+        |           +--ro oc-tun:src?       oc-inet:ip-address
+        |           +--ro oc-tun:dst?       oc-inet:ip-address
+        |           +--ro oc-tun:ttl?       uint8
+        |           +--ro oc-tun:gre-key?   uint32
         ...
-        +--rw oc-vlan:routed-vlan
+        x--rw oc-vlan:routed-vlan
         |  ...
-        +--rw oc-tun:tunnel
+        x--rw oc-tun:tunnel
            ...

Future scope/items

WiFi (out of scope, needs follow-up)

  • openconfig-ap-interfaces reuses oc-tun:tunnel-top, so the AP interface
    level tunnel also shows as deprecated with this change. It continues to
    work as-is. The equivalent subinterface/tunnel anchor for the AP model is
    left for a follow-up w/ the wifi maintainers.

Deprecated path removal

  • Removal of the interface level tunnel and routed-vlan containers to be
    targeted for a future major version once implementations and featureprofiles
    have migrated

  * (M) release/models/interfaces/openconfig-if-tunnel.yang
    - Add tunnel container under subinterface for interfaces of type
      tunnel
    - Deprecate interface level tunnel container, including
      tunnel/ipv4 and tunnel/ipv6
    - Increment version to 0.2.0
  * (M) release/models/vlan/openconfig-vlan.yang
    - Add routed-vlan container under subinterface for interfaces of
      type l3ipvlan
    - Deprecate interface level routed-vlan container, including
      routed-vlan/ipv4 and routed-vlan/ipv6
    - Increment version to 3.3.0
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the OpenConfig models to standardize the configuration of tunnel and routed-vlan interfaces. By moving these configurations under the subinterface hierarchy, the models now follow the same pattern used by other L3 interfaces in OpenConfig. The changes are additive and backward-compatible, with existing paths marked as deprecated to signal the transition to the new structure.

Highlights

  • Subinterface Migration: Relocated 'tunnel' and 'routed-vlan' containers to the subinterface level to align with standard OpenConfig L3 interface patterns.
  • Deprecation: Marked the existing interface-level 'tunnel' and 'routed-vlan' containers as deprecated to encourage migration while maintaining backward compatibility.
  • Model Versioning: Incremented the version of openconfig-if-tunnel.yang to 0.2.0 and openconfig-vlan.yang to 3.3.0.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the OpenConfig interface tunnel and VLAN models by deprecating the interface-level tunnel and routed-vlan containers and introducing them under subinterfaces instead. The review comment provides a detailed platform implementation comparison across major network operating systems, confirming that the changes comply with OpenConfig guidelines for vendor-neutral modeling.

Comment on lines +28 to +36
revision "2026-11-05" {
description
"Add tunnel configuration under subinterfaces for interfaces
of type tunnel. Deprecate the interface level tunnel
container, including tunnel/ipv4 and tunnel/ipv6, in favor of
the subinterface tunnel container and
subinterfaces/subinterface/ipv4|ipv6.";
reference "0.2.0";
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Platform Implementation Comparison

In accordance with the Repository Style Guide (Section 2, Rules 12-18), here is a comparison of the proposed YANG changes (moving "tunnel" and "routed-vlan" under subinterfaces) with the reference implementations of major network operating systems:

Network OS Feature / Container Command / Configuration Example Documentation Link Match Strength
Cisco IOS-XR Tunnel interface Tunnel-IP1
tunnel mode gre ipv4
tunnel source IP
tunnel destination IP
Cisco IOS-XR Tunnel Configuration Guide Strong (flat interface, maps to subinterface 0)
Cisco IOS-XR Routed VLAN (IRB/SVI) interface BVI100
ipv4 address 192.0.2.1 255.255.255.0
Cisco IOS-XR Bridging Configuration Guide Strong (flat interface, maps to subinterface 0)
Nokia SR Linux Tunnel tunnel-interface tunnel-1
vxlan-interface 1
Nokia SR Linux Interfaces Guide Strong (supports subinterfaces natively)
Nokia SR Linux Routed VLAN (IRB) interface irb1
subinterface 1
ipv4 { address 192.168.1.1/24 }
Nokia SR Linux IRB Interfaces Guide Strong (supports subinterfaces natively)
Juniper JunOS Tunnel set interfaces fti0 unit 1 tunnel encapsulation gre
set interfaces fti0 unit 1 family inet address 10.0.0.1/31
Juniper JunOS Tunnel Configuration Guide Strong (supports logical units/subinterfaces natively)
Juniper JunOS Routed VLAN (IRB) set interfaces irb unit 10 family inet address 10.10.0.1/24 Juniper JunOS IRB Interfaces Guide Strong (supports logical units/subinterfaces natively)
Arista EOS Tunnel interface Tunnel1
tunnel mode gre
ip address 10.0.0.1/30
Arista EOS Tunnel Interfaces Guide Strong (flat interface, maps to subinterface 0)
Arista EOS Routed VLAN (SVI) interface Vlan100
ip address 192.0.2.1/24
Arista EOS VLAN Interfaces Guide Strong (flat interface, maps to subinterface 0)
NVIDIA Cumulus Tunnel nv set interface gre0 ip tunnel source 192.0.2.1
nv set interface gre0 ip tunnel destination 192.0.2.2
NVIDIA Cumulus Linux Tunneling Guide Strong (flat interface, maps to subinterface 0)
NVIDIA Cumulus Routed VLAN (SVI) nv set interface vlan100 ip address 192.0.2.1/24 NVIDIA Cumulus Linux SVI Guide Strong (flat interface, maps to subinterface 0)
SONiC Tunnel CONFIG_DB VXLAN_TUNNEL table SONiC VXLAN HLD Strong (flat interface, maps to subinterface 0)
SONiC Routed VLAN (SVI) CONFIG_DB VLAN_INTERFACE table SONiC VLAN HLD Strong (flat interface, maps to subinterface 0)

Conclusion

Since all six reference implementations have a strong match with the proposed YANG changes (either natively supporting subinterfaces/logical units, or mapping flat interfaces to subinterface index 0), this change meets the minimum OpenConfig guidelines for vendor-neutral modeling.

References
  1. Compare the YANG changes with the documentation of implementations of network operating systems from Cisco IOS-XR, Nokia SR Linux, Juniper JunOS/JunOS Evolved, Arista EOS, NVIDIA Cumulus Linux and SONiC, generating a table comparing the affected OpenConfig leaves/containers with links to relevant documentation. (link)
  2. Ensure that documentation references for network operating system implementations (such as Arista EOS, Juniper JunOS, and Cisco IOS-XR) are publicly accessible and point to the correct, working URLs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant