How to Configure and Switch WSL2's Networking Mode
A complete walkthrough switching between WSL2's default NAT networking and mirrored networking mode — and how to verify which one actually solves your specific reachability problem.
WSL2 supports two distinct networking modes — this walks through configuring and verifying each one directly.
Step 1: check your current networking mode
cat /etc/resolv.conf
ip addr
Comparing the IP address range assigned to WSL2 against your actual LAN’s address range gives a quick clue — a distinctly different private range (like 172.x.x.x when your LAN uses 192.168.x.x) generally indicates NAT mode; a matching range suggests mirrored mode is already active.
Step 2: identify why you might need to switch
Need a service running inside WSL2 to be reachable
from another device on your LAN? → mirrored mode
helps directly
Experiencing VPN-related connectivity or DNS issues
under NAT mode specifically? → mirrored mode is
worth trying
Step 3: edit .wslconfig to enable mirrored mode
%UserProfile%\.wslconfig
[wsl2]
networkingMode=mirrored
Step 4: fully restart WSL2 for the change to take effect
wsl --shutdown
Then relaunch your distro — networking mode changes require this full restart, not just reopening a terminal window.
Step 5: verify the new networking mode is active
ip addr
Confirm the WSL2 network interface now shows an address matching your actual host’s LAN configuration, rather than a separate NAT-translated range.
Step 6: test LAN reachability directly
# from inside WSL2, start a simple test server:
python3 -m http.server 8000
Then, from a different device on the same network, try reaching your host machine’s actual LAN IP address on port 8000 — successfully reaching it confirms mirrored mode’s direct reachability improvement is actually working.
Step 7: revert to NAT mode if mirrored mode causes different issues
[wsl2]
networkingMode=nat
Mirrored mode isn’t universally better for every setup — some VPN configurations or specific network environments behave better under the original NAT default, and reverting is as simple as changing this setting back and restarting WSL2 again.
Step 8: test VPN behavior specifically if that was your original motivation
If you switched modes specifically to address VPN-related connectivity issues, test with your VPN actually connected in both modes to directly compare behavior, rather than assuming the mode switch resolved the issue without confirming it under real conditions.
Why testing both modes directly, rather than picking based on general advice, matters
Networking behavior depends heavily on your specific router, VPN client, and network configuration — general guidance about which mode is “better” can’t account for your specific setup’s particulars, making a direct, deliberate test of your actual reachability or connectivity concern the only way to confirm which mode genuinely works better for you.