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

Add a neutral networkingMode in C:\Users\user\.wslconfig #11632

Open
colemar opened this issue May 29, 2024 · 5 comments
Open

Add a neutral networkingMode in C:\Users\user\.wslconfig #11632

colemar opened this issue May 29, 2024 · 5 comments
Labels

Comments

@colemar
Copy link

colemar commented May 29, 2024

Is your feature request related to a problem? Please describe.
Cannot tell WSL2 to leave eth0 alone, that is don't set IP address, mask, routes.

Describe the solution you'd like
Some setting in .wslconfig like: networkingMode = noip

Describe alternatives you've considered
Add this to /etc/wsl.conf

[boot]
command = ip address flush dev eth0

Why?
Because being unable to make networkingMode = bridged work, I resorted to this solution:

  1. wsl --shutdown
  2. open Hyper-V Manager / Virtual Switch Manager
  3. click on Virtual Switches / WSL
  4. enable External Network and select the LAN interface
  5. Click Apply
  6. Start WSL Ubuntu 22.04.2
  7. sudo -i
  8. vi /usr/lib/systemd/network/wsl_external.network
[Match]
Name=eth0
[Network]
Description=WSLBridge
DHCP=true
  1. vi /etc/wsl.conf
[boot]
systemd=true
  1. echo "nameserver 192.168.0.1" > /etc/resolv.conf
  2. systemctl enable systemd-networkd
  3. systemctl enable systemd-resolved
  4. wsl --shutdown
  5. Start WSL Ubuntu 22.04.2
  6. ip addr shows that eth0 has two ip addresses: 172.x.x.x.x and 192.168.0.x (the first I believe is related to NAT)
  7. ip route shows two default routes

Additional context
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.4412

Copy link

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@colemar
Copy link
Author

colemar commented May 29, 2024

WSL logs
WslLogs-2024-05-29_23-44-06.zip

Copy link

The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running.

Diagnostic information
.wslconfig found
appxpackage.txt not found
Found no WSL traces in the logs

@colemar
Copy link
Author

colemar commented May 29, 2024

image

@colemar
Copy link
Author

colemar commented May 29, 2024

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

1 participant