-
Notifications
You must be signed in to change notification settings - Fork 859
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
Unnecessary network devices created #7791
Comments
Do you know what settings I would have to change in the kernel to stop these from being created? I found the line in the config file to disable sit0, but I'm not sure about tunl0; I have to disable them as due to their abnormal MAC address length a program I'm using is getting a segfault since it tries reading their MAC address for license activation but tries reading beyond their length. Also, if you know a way to permanently set the MAC address of eth0 please let me know, its not essential but it would save me the work of creating a virtual interface and setting its MAC address to the one linked to my license key every time. |
Those network interfaces are enabled by default. Generally those do not interfere with eth0 or any network operations. If you want to remove those network interface you can use basic sudo ip link delete dummy0
sudo ip link delete bond0 Or you can disable creation of dummy0 by recompiling Linux kernel with It is possible to set a MAC address by creating a new virtual network and endpoint, detach the old one and attach the new one in WSL2. |
I'm only able to delete dummy0 and bond0 with ip link delete, I'm having a problem with sit0 and tunl0 though, they have the MAC address 00-00-00-00 which is an abnormal size as usually MAC addresses are in the form xx-xx-xx-xx-xx-xx; this is causing a segmentation fault on a program I'm trying to use. Do you know which settings I would need to disable in the kernel to disable the sit0 and tunl0 interfaces? |
The root cause is that WSL kernel is monolithic and does not use kernel modules.
The first tells bonding not to make any devices by default. Second does same for dummy device.
|
Linux kernel command line options can be added in .wslconfig file. Create a [wsl2]
kernelCommandLine = bonding.max_bonds=0 dummy.numdummies=0 fb_tunnels=2 Run |
This removed the dummy0 and bond0 interfaces for me, but sit0 and tunl0 are still there. Are there any other settings that are needed to remove those? |
Those do not have any MAC address.
Wait a second! It seems that the issue is with that software. Why does a software (or a spyware) scan all available network interfaces?
They don't have MAC address. Only bond0 and dummy0 have MAC address which are in valid format always. |
It reads them for licensing purposes; this is the last few lines of the strace output from the application:
Is there something I can change in the config-wsl file for the kernel to remove these interfaces? I tried turning off CONFIG_NET_IPIP and CONFIG_IPV6_SIT but I get errors while compiling the kernel with those settings. |
This is workaround that worked for me
Any license code that reads list of available network devices is broken. There is no way to be sure network device MAC address is not changed or will be the same under a whole range of scenarios. One could argue all DRM code is fundamentally flawed. |
This is not an area I'm very experienced in, what would the implications be of setting max_bonds, numdummies, and fb_tunnels to zero / none? Would this break any existing workflow? |
I doubt it would cause problems, these default devices are a legacy thing from early days of Linux (like 10+ yrs ago). |
@shemminger - thanks for the context - I'll see if I can figure out why these got added. |
I
I fixed my segfault, turned out that it wasn't caused by the extra network devices; I fixed it by adding "vsyscall=emulate" to my kernelCommandLine. For keeping the same MAC address, I ran |
how would you go about recovering these extra networks if they suddenly disappeared? |
These devices are not useful or used. Modern Linux distros handle device management using network manager or related infrastructure. |
ok, but I need bond0 to verify my MATLAB license, |
Same here |
Then make a dummy bond device with command line or with /etc/network/interfaces. |
For others who have come here looking for a solution after their tools stop working, add the following to your # Define the interface name and MAC address
ifname=bond0
wantmac=<your_mac_here>
# Check if the interface already exists
ip link show $ifname |& grep -q ether
if [[ $? == 1 ]]; then
sudo ip link add $ifname type bond
fi
# Set the MAC address if it's different to what we want
mac=$(ip link show $ifname | awk '/ether/ {print $2}')
if [[ $mac != $wantmac ]]; then
sudo ip link set dev $ifname address $wantmac
fi |
Version
Microsoft Windows [Version 10.0.22000.318]
WSL Version
Kernel Version
5.10.60.1-microsoft-standard-WSL2
Distro Version
Debian GNU/Linux 11 (bullseye)
Other Software
No response
Repro Steps
Tools that show list of network interfaces discover unwanted devices: bond0, dummy0, etc
This is an unwanted side effect caused by bonding, dummy, etc being built into the kernel rather being loadable modules.
A workaround would be to add parameters to those modules to not have them create default devices.
Expected Behavior
I would expect:
Actual Behavior
What I see when doing network device commands is.
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: