microsoft / microsoft/WSL

Add support to specify VLAN # when using Bridged Network Mode

Open
#13,665 6 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

Trying to use Bridged mode in WSL2 on Windows Server 2025 and need to use a VLAN number.
This is a Hyper-V server running several other Windows VMs, each has their Virtual NICs on different VLANs.

Need WSL to use a VLAN on it's virtual NIC that is on the virtual switch like other VMs that are configurable in HyperV Manager.

Maybe something in .wslconfig

```
[wsl2]
networkMode=bridged
vmSwitch="VirtualSwitch"
networkBridgedVlan=123

```

Some AI searches offered some workarounds but nothing works.

Using a native VLAN on the interface would disrupt other VMs already using the VLAN.

Windows Server 2025 does not support mirrored mode.

Thanks,

Contributor guide

Open the contributing guide

Research direction

Start by tracing how WSL reads the [wsl2] .wslconfig settings for networkMode and vmSwitch, then inspect the bridged networking path. Done means a VLAN value such as networkBridgedVlan=123 is accepted and applied to the WSL virtual NIC on the selected Hyper-V switch, with coverage for the requested configuration.

Written by the indexing model from the issue text.

Assessment

Domain
networking, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.