microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.34k stars 814 forks source link

Send all Windows traffic to WSL2 for IPTABLES firewall use with or without Windows FW #6251

Open packetman007 opened 3 years ago

packetman007 commented 3 years ago

Might I be able to force all Windows network traffic through WSL2 to use IPTABLES mangle instead or in additioon to Windows Firewall?

Perhaps by "Bridging" from Windows to WSL2 and let WSL2 communicate to and from the wire using IPTABLES with ability to use IPTABLES as firewall?

Of course they work independently albeit with Nat addresses... I'd like to use one IP for all bidirectional communications enabling the IPTABLES firewall instead of Windows.... too many limitations in Windows Firewall.

Appreciate any hints or thoughts, tested or theoretical - hypothetical.

sirredbeard commented 3 years ago

That is an interesting idea.

It may be possible to create a proxy or OpenVPN server in WSL, forward the ports through the Window Firewalls, and then connect Windows as a client, but it could also result in unexpected behavior or a time singularity.

My other thought is that iptables is mostly being deprecated in favor of nftables.