Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

networkingMode=mirrored makes Podman unable to forward ports #11136

Closed
1 of 2 tasks
simorex80 opened this issue Feb 8, 2024 · 14 comments
Closed
1 of 2 tasks

networkingMode=mirrored makes Podman unable to forward ports #11136

simorex80 opened this issue Feb 8, 2024 · 14 comments
Labels

Comments

@simorex80
Copy link

Windows Version

Microsoft Windows [Versione 10.0.22631.3007]

WSL Version

2.0.14.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.133.1-1

Distro Version

No response

Other Software

Podman Desktop v1.7.1
Podman v4.9.2

Repro Steps

Change in .wslconfig networkingMode=mirrored
Restart WSL2
Execute podman run -d -p 8080:80 nginx:alpine (example)
Open to http://localhost:8080
Result: cannot connect

Expected Behavior

To forward the port and be able to connect to my containers.

Actual Behavior

Doesn't forward the port, so I cannot connect to my containers.

Diagnostic Logs

No response

@fgapito
Copy link

fgapito commented Feb 8, 2024

I have the same error. Following...

@massimogentilini
Copy link

Same error here, following

@massimogentilini
Copy link

To provide more context:

wsl --version
WSL version: 2.1.0.0
Kernel version: 5.15.137.3-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.3085

podman version
Client: Podman Engine
Version: 4.9.2
API Version: 4.9.2
Go Version: go1.21.6
Git Commit: f9a48ebcfa9a39144be0f86f4ba842752835f945
Built: Sat Feb 3 00:29:04 2024
OS/Arch: windows/amd64

Server: Podman Engine
Version: 4.9.0
API Version: 4.9.0
Go Version: go1.21.6
Built: Wed Jan 24 11:07:27 2024
OS/Arch: linux/amd64

@slyfer
Copy link

slyfer commented Feb 9, 2024

Same error for me

@chanpreetdhanjal
Copy link

Hi. Can you please collect networking logs by following the instructions below?
https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

@rde9
Copy link

rde9 commented Feb 17, 2024

same error here

@simorex80
Copy link
Author

Hi. Can you please collect networking logs by following the instructions below? https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

Here the dump from my laptop.
WslNetworkingLogs-2024-02-19_13-59-51.zip

@klesh
Copy link

klesh commented Feb 25, 2024

Same problem.

@Wladastic
Copy link

same

@Tonyangl
Copy link

Tonyangl commented Apr 3, 2024

I have the same error. Following...

@lslkk
Copy link

lslkk commented Apr 3, 2024

Same problem.

@massimogentilini
Copy link

I've come around a possible solution:

Change SubNet of WSL NAT-Router to a different one which does not collide with your VPN or Network policies

To do so got to regedit and edit the following entries (IPs should be neutral enough to work everywhere):

Path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss 
Entry: NatGatewayIpAddress Value: 100.64.0.1
Entry: NatNetwork Value: 100.64.0.0/20

Restart the PC

Let us know if this works.

@Wladastic
Copy link

I have found a fix.
Close your WSL application that would be forwarded.

Then inside admin Powershell run:
netsh interface portproxy reset

Now start your application inside WSL again.

Now run:
netsh interface portproxy reset
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=7860 connectaddress=127.0.0.1 connectport=7860

For some reason you need to run the reset quickly before doing the portproxy again.
This works 100%.

If you close your application that is forwarded, you have to run the reset command again.

@benhillis
Copy link
Member

Fixed with https://github.com/microsoft/WSL/releases/tag/2.3.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests