Dynamic bridged subinterfaces
In data centers, server hosts are often pre-provisioned with many VLANs so that new services can be added without reconfiguring the host or fabric orchestration layer.
SR Linux uses an interface-scoped VLAN model in which bridging, QoS, and ACLs are configured for each subinterface. Creating a static subinterface for every possible VLAN on each server-facing port does not scale efficiently when thousands of VLANs are available.
Dynamic bridged subinterfaces address this limitation by allowing you to configure a VLAN range on an interface. The system detects active VLANs and reports them in state, while an event handler script creates the corresponding bridged subinterfaces and MAC-VRF bindings only for VLANs that become active.
How dynamic bridged subinterfaces work
Dynamic bridged subinterfaces separate VLAN detection which is handled by the platform, from service creation which is handled by an event handler script.
The following figure illustrates an example in which the hypervisor is configured with
1..500 VLANs, but only VLAN 1 has transmitted traffic. Instead of requiring 1..500
static subinterfaces on router interface ethernet-1/1, SR Linux creates the
subinterface and associated configuration only for VLAN 1, when VLAN 1 becomes
active.
The following sequence describes the process.
-
First packet arrival: A data frame for VLAN 1 arrives on interface
ethernet-1/1. The interface is configured for VLAN tagging and dynamic subinterfaces with a VLAN range that includes VLAN 1 (VLANs 1 through 1500 in the figure). Because no subinterface exists for VLAN 1, the platform punts a copy of the frame to the CPM for VLAN learning. -
Active VLAN detection: The
vlan_detection_mgrapplication processes the extracted traffic and, in EVPN multi-homing deployments, other triggers such as Ethernet Segment destination state. It adds VLAN 1 to theactive-vlansleaf-list forethernet-1/1. In the figure,active-vlanscontains[1], while the other pre-provisioned VLANs on the host remain inactive. -
Event handler execution: The management server publishes the change to
ethernet-1/1’sdynamic-subinterfaces active-vlanspath. An event handler subscribed to this path invokes a MicroPython script throughevent_mgr. The script returns configuration actions to create a bridged subinterface and bind it to a MAC-VRF. For example,ethernet-1/1.1is created in network instancemac-vrf1, withtype bridgedandvlan encap single-taggedandvlan-id 1.. See the SR Linux Event Handler Guide for more information about event handler framework. -
Steady-state forwarding: After the subinterface and MAC-VRF binding are programmed, subsequent frames for VLAN 1 are forwarded through the new subinterface in the dataplane, like traffic on any other bridged subinterface.
The lower portion of Dynamic bridged subinterfaces - example packet flow shows the interface detection configuration, including the VLAN range and retention
timer, and the resulting configuration created by the event handler, including the
bridged subinterface and its network instance interface binding. Detection parameters
are configured under interface <name> dynamic-subinterfaces, while
the script creates subinterfaces and MAC-VRF bindings as standard configuration
objects.
The retention-timer parameter determines how long a VLAN remains in
active-vlans after traffic stops. In the figure, the timer is set
to 5 minutes for illustration; the default is 240 minutes. When a VLAN ages out, the
script can remove its dynamic subinterface and, if no other interfaces use the VLAN,
tear down the associated MAC-VRF.
The following table describes the components and roles.
| Stage | Component | Role |
|---|---|---|
| Dataplane | Ethernet or LAG interface |
Punts the first frames for VLAN IDs within the configured vlan-range that do not match an existing subinterface. |
| Control plane | vlan_detection_mgr |
Maintains the |
| Management | Management server |
Publishes |
| Automation | event_mgr + MicroPython script |
Creates or deletes bridged subinterfaces and MAC-VRF bindings, and optionally configures VXLAN and BGP EVPN objects. |
The following example illustrates the resulting configuration for VLAN 1.
Bridged subinterface configuration
--{ + candidate shared default }--[ ]--
# info from state interface ethernet-1/1 dynamic-subinterfaces
interface ethernet-1/1 {
dynamic-subinterfaces {
vlan-range 1..1500 {
}
retention-timer 5
active-vlans [
1
]
}
}
MAC-VRF and bridged subinterface binding
-{ + running }--[ ]--
# info with-context interface ethernet-1/1 subinterface 1
interface ethernet-1/1 {
subinterface 1 {
type bridged
vlan {
encap {
single-tagged {
vlan-id 1
}
}
}
}
}
--{ + running }--[ ]--
# info with-context network-instance mac-vrf1 interface ethernet-1/1.1
network-instance mac-vrf1 {
interface ethernet-1/1.1 {
interface-ref {
interface ethernet-1/1
subinterface 1
}
}
}
The VLAN detection configuration is operator-configured. The bridged subinterface and MAC-VRF binding are standard configuration objects created by the event handler script.
Prerequisites and resource management
Before enabling dynamic bridged subinterfaces, ensure that the following requirements are met.
- Configure
vlan-tagging trueon the parent Ethernet or LAG interface. - Configure
dynamic-subinterfacesonly on Ethernet or LAG interfaces that do not use optional VLAN subinterfaces. - Ensure that CPM filters allow the extracted trigger packets. CPM filtering uses separate MAC, IPv4, and IPv6 filter groups. Factory-default CPM filters allow common IPv4 and IPv6 traffic but may not allow all MAC-based triggers. For non-IP triggers, add an explicit rule to the MAC CPM filter group.
On 7250 IXR systems, the first
dynamic-subinterfaces configuration on any interface requires an
explicit system resource setting. Configure the platform resource-management
dynamic-subinterfaces max-vlans command to 4095 to enable
the full VLAN range, including untagged traffic. The only supported values are
0 (disabled) and 4095. Changing
max-vlans sets the chassis-reboot-required true
parameter value. Reboot the chassis before the new value takes effect.
The following example configures the maximum VLAN resource allocation on a 7250 IXR system.
--{ * candidate shared default }--[ ]--
# info with-context platform resource-management dynamic-subinterfaces
platform {
resource-management {
dynamic-subinterfaces {
max-vlans 4095
}
}
}
Changing max-vlans sets chassis-reboot-required to
true. Reboot the chassis for the new resource setting to take
effect.
Enabling dynamic subinterfaces on 7250 IXR nodes reduces the hardware forwarding resources available for operator MAC-VRFs and routed subinterfaces. See Limitations and interactions.
Configuring VLAN detection
Configure the dynamic-subinterfaces parameter under the parent ethernet or lag interface. The vlan-range list defines the VLAN IDs for which the dataplane can punt packets to trigger subinterface creation and which the VLAN detection manager monitors.
Each vlan-range entry specifies a contiguous range. Supported values are as follows.
-
untagged, for untagged traffic and traffic that the platform treats as untagged
-
single-tagged with low-vlan-id and high-vlan-id from 1 through 4094.
Configure the following parameters as required:
-
retention-timer — Specifies how long, in minutes, a VLAN remains in active-vlans after activity stops. The default is 240 minutes, aligned with the default ARP and IPv6 Neighbor Discovery (ND) timeouts. The supported range is 1 through 65535.
-
retention-refresh — Specifies which subinterface statistics refresh the retention timer:
-
ingress-and-egress-stats (default): Refreshes the timer when any ingress or egress subinterface counter changes. Use this setting when silent hosts receive little ingress traffic but continue to generate egress traffic.
-
ingress-stats: Refreshes the timer only when ingress statistics change. Egress broadcast, unknown unicast, and multicast (BUM) traffic from other hosts in the same MAC-VRF does not keep the VLAN active. Use this setting in scale scenarios where egress BUM traffic could otherwise prevent a VLAN from aging out after a host moves.
Nokia recommends using the VLAN ID as the subinterface index. For example, use subinterface 1 for VLAN 1.
VLAN detection for VLANs 1 through 1500
The following example configures VLAN detection for VLANs 1 through 1500 on ethernet-1/1.
--{ * candidate shared default }--[ ]--
# info with-context interface ethernet-1/1 dynamic-subinterfaces
interface ethernet-1/1 {
vlan-tagging true
dynamic-subinterfaces {
vlan-range 1..1500 {
}
retention-timer 240
retention-refresh ingress-and-egress-stats
}
}
Displaying active VLANs
The active-vlans leaf-list under interface
dynamic-subinterfaces command identifies the VLAN IDs that the
vlan_detection_mgr currently considers active on the
interface.
Use the info from state interface ethernet-1/1 dynamic-subinterfaces active-vlans command to display the active VLANs.
Displaying active VLANs
The example displays the VLANs currently considered active by the detection mechanism. It does not, by itself, confirm that the event handler has successfully created and programmed the corresponding subinterfaces and MAC-VRF bindings.
--{ + running }--[ ]--
# info from state interface ethernet-1/1 dynamic-subinterfaces active-vlans
interface ethernet-1/1 {
dynamic-subinterfaces {
active-vlans [
1
100
200
]
}
}
Forcing VLAN aging
Use the tools interface ethernet-1/1 dynamic-subinterfaces retention-timer active-vlan-id 100 clear command to force immediate aging of a specific VLAN. Replace 100 with the VLAN ID to clear its retention state. To clear the retention state for all active VLANs on the interface, use active-vlan-id all instead.
Integrating event handler
SR Linux does not automatically create subinterfaces when a VLAN becomes active.
Configure an event handler instance to monitor active-vlans and
execute a MicroPython script that creates the required service configuration.
Nokia provides two reference scripts in /opt/srlinux/eventmgr.
dynamic-subinterfaces.py— Intended for single-homed ports. Creates bridged subinterfaces, per-VLAN MAC-VRF network instances (for example,VLAN-<id>orVLAN-untagged), and VXLAN-related interfaces. It also enables BGP EVPN/BGP VPN when the first subinterface for a VLAN appears.dynamic-subinterfaces-multi-homing.py— Intended for EVPN Ethernet Segment multi-homing. Supports the creation and removal of subinterfaces and MAC-VRF bindings, as well as provisioning MAC-VRFs, VLANs, EVPN, and the Ethernet Segment.
Review the reference script for its exact configuration behavior and naming conventions before deploying it.
event handler configuration
The following example enables an event handler instance named
dyn-subifs to run dynamic-subinterfaces.py
when the active-vlans state changes on
ethernet-1/1.
--{ * candidate shared default }--[ ]--
# info with-context system event-handler instance dyn-subifs
system {
event-handler {
instance dyn-subifs {
admin-state enable
upython-script dynamic-subinterfaces.py
paths [
"interface ethernet-1/1 dynamic-subinterfaces active-vlans"
]
}
}
}
The event handler monitors the specified state path and invokes the script when a relevant change is published. The script returns configuration actions to create or remove the required service objects.
Deployment scenarios
Single-homed server ports
Perform the following to enable dynamic bridged subinterfaces on single-homed server ports.
- Configure
dynamic-subinterfacesandvlan-rangeon the server-facing interface. - Configure CPM filters to allow the required trigger packet types.
- Enable an event handler instance that runs
dynamic-subinterfaces.pyor a custom script. - Optionally, enable automatic system configuration saving in the script if dynamically created configuration must persist across reboots.
EVPN multi-homing
For EVPN Ethernet Segment (ES) multi-homing, use
dynamic-subinterfaces-multi-homing.py when MAC-VRFs, VLANs, and
EVPN are pre-provisioned according to the script’s expected naming conventions, such
as VLAN-<vlan-id>.
The vlan_detection_mgr can add VLAN IDs to
active-vlans based on ES destination state in the fabric. This
allows sibling leaf nodes to create matching subinterfaces even when the customer
edge device hashes traffic to only one leaf.
For single-active multi-homing, retain an anchor static subinterface on a VLAN
outside the dynamic vlan-range. This prevents standby signaling
from being aged out.
See "EVPN multi-homing" chapter in the SR Linux VPN Services Guide for more information about EVPN multi-homing.
Trigger traffic and protocol handling
Typical trigger traffic includes:
- Address Resolution Protocol (ARP)
- IPv6 Neighbor Discovery
- Dynamic Host Configuration Protocol (DHCP)
The platform uses qualifying traffic to identify VLANs that are active within the configured range.
On 7220 IXR-Dx platforms, Spanning Tree Protocol (STP) and Layer 2 control protocol (L2CP) frames do not trigger VLAN detection. After a subinterface exists, STP and L2CP frames are handled normally on that subinterface.
Ensure that the required trigger traffic is permitted by the relevant CPM filters, especially when using MAC-based, non-IP triggers.
Limitations and interactions
- Dot1q ranges:
dot1q-rangesanddynamic-subinterfacesare mutually exclusive on the same interface. - Optional VLAN subinterfaces: Not supported on interfaces configured with
dynamic-subinterfaces. - Port MEP: Ethernet in the First Mile (EFM) port MEP is not supported on interfaces with a dynamic VLAN range.
- Hardware resources on 7250 IXR: Configuring
max-vlans 4095leaves fewer hardware forwarding resources for operator MAC-VRFs and routed subinterfaces. If hardware resources are exhausted, the operational-down reason is reported asno-hardware-resources.
Operational verification
After configuring dynamic bridged subinterfaces, verify the following:
- The parent interface has VLAN tagging enabled and the expected
vlan-rangeconfigured. - The
active-vlansstate reflects VLANs that have generated qualifying trigger traffic or other supported detection events. - The event handler instance is enabled and subscribed to the correct state path.
- The event handler script creates the expected bridged subinterfaces and MAC-VRF bindings.
- The resulting configuration uses the expected VLAN IDs, subinterface indexes, network-instance names, and encapsulation settings.
- Traffic is forwarded successfully after the subinterface and service configuration are programmed.
- On 7250 IXR systems,
verify resource availability and check
chassis-reboot-requiredafter changingmax-vlans.
This separation between VLAN detection and service creation allows SR Linux to support large pre-provisioned VLAN ranges without requiring a static subinterface for every VLAN on every server-facing interface.