microsoft / microsoft/WSL

Access running WSL services from LAN devices without having to create Firewall rules with `networkingMode=mirrored`

Open
#10,769 7 comments 3 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

**Is your feature request related to a problem? Please describe.**

[This](https://youtu.be/OB2Rfzy5V0Y?t=494) video demo of the new `networkingMode = mirrored` (at around 8:19 minutes) seems to suggest that services running inside WSL can be accessed from other devices on the same LAN without needing any extra setup. But in my experience LAN devices **cannot** access WSL services until you explicitly allow that port in the firewall rule.

I tried toggling the new `experimental.firewall`/`wsl2.firewall`, but it doesn't seem to make any difference.

**Describe the solution you'd like**

I think one of these solution should work:
1. Let the user disable Firewall for WSL. (I expected `experimental.firewall = false` to do this)
2. If firewall rules cannot be turned off completely for WSL, auto manage firewall rules for each service running within WSL, and prompt the user for consent if necessary.

**Additional Details:**

```pwsh
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.2506
```

```sh
$ wslinfo --networking-mode
mirrored
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported behavior with WSL 2.0.9.0 in mirrored mode, using wslinfo --networking-mode and a service reachable from another LAN device. Review how experimental.firewall and wsl2.firewall affect access and determine the intended behavior; done means the agreed firewall handling works without manually creating a rule for each service, with appropriate tests or documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
networking, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.