You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
$ ip -br a
lo UNKNOWN 127.0.0.1/8 ::1/128
eth0 UP 192.168.126.91/20 fe80::215:5dff:feee:2fe/64
Actual Behavior
What I see when doing network device commands is.
$ ip -br a
lo UNKNOWN 127.0.0.1/8 ::1/128
bond0 DOWN
dummy0 DOWN
tunl0@NONE DOWN
sit0@NONE DOWN
eth0 UP 192.168.126.91/20 fe80::215:5dff:feee:2fe/64
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.
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 ip commands.
sudo ip link delete dummy0
sudo ip link delete bond0
Or you can disable creation of dummy0 by recompiling Linux kernel with CONFIG_DUMMY disabled.
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.
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 ip commands.
sudo ip link delete dummy0
sudo ip link delete bond0
Or you can disable creation of dummy0 by recompiling Linux kernel with CONFIG_DUMMY disabled.
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.
Some of these drivers allow setting module parameters that might help. But these would have to go on kernel boot command line, not sure how to change that with WSL.
Examples:
bonding.max_bonds=0
dummy.numdummies=0
fb_tunnels=2
The first tells bonding not to make any devices by default. Second does same for dummy device.
The last does:
Controls if fallback tunnels (like tunl0, gre0, gretap0, erspan0,
sit0, ip6tnl0, ip6gre0) are automatically created. There are 3 possibilities
(a) value = 0; respective fallback tunnels are created when module is
loaded in every net namespaces (backward compatible behavior).
(b) value = 1; [kcmd value: initns] respective fallback tunnels are
created only in init net namespace and every other net namespace will
not have them.
(c) value = 2; [kcmd value: none] fallback tunnels are not created
when a module is loaded in any of the net namespace. Setting value to
"2" is pointless after boot if these modules are built-in, so there is
a kernel command-line option that can change this default. Please refer to
Documentation/admin-guide/kernel-parameters.txt for additional details.
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.
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).
Earlier versions of WSL kernel did not appear to have this.
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.
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 echo "ip link set dev dummy0 address <mac address here>" >> ~/.bashrc to set the MAC address of the dummy0 interface to the one linked to my license every time WSL starts.
Activity
zer0-memory commentedon Dec 3, 2021
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.
Biswa96 commentedon Dec 3, 2021
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
ipcommands.Or you can disable creation of dummy0 by recompiling Linux kernel with
CONFIG_DUMMYdisabled.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.
zer0-memory commentedon Dec 3, 2021
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?
shemminger commentedon Dec 3, 2021
The root cause is that WSL kernel is monolithic and does not use kernel modules.
Some of these drivers allow setting module parameters that might help. But these would have to go on kernel boot command line, not sure how to change that with WSL.
Examples:
The first tells bonding not to make any devices by default. Second does same for dummy device.
The last does:
Biswa96 commentedon Dec 3, 2021
Linux kernel command line options can be added in .wslconfig file. Create a
.wslconfigfile in%UserProfile%directory and add the lines like thisRun
wsl.exe --shutdownto forcefully shutdown WSL2 VM and re-run the Linux distribution in WSL2.zer0-memory commentedon Dec 5, 2021
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?
Biswa96 commentedon Dec 5, 2021
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.
zer0-memory commentedon Dec 5, 2021
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.
shemminger commentedon Dec 6, 2021
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.
benhillis commentedon Dec 6, 2021
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?
shemminger commentedon Dec 6, 2021
I doubt it would cause problems, these default devices are a legacy thing from early days of Linux (like 10+ yrs ago).
Earlier versions of WSL kernel did not appear to have this.
benhillis commentedon Dec 6, 2021
Stephen Hemminger (@shemminger) - thanks for the context - I'll see if I can figure out why these got added.
zer0-memory commentedon Dec 8, 2021
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
echo "ip link set dev dummy0 address <mac address here>" >> ~/.bashrcto set the MAC address of the dummy0 interface to the one linked to my license every time WSL starts.benhillis commentedon Apr 4, 2023
Fixed with https://github.com/microsoft/WSL/releases/tag/1.1.7.
romarowski commentedon Apr 18, 2023
how would you go about recovering these extra networks if they suddenly disappeared?
shemminger commentedon Apr 18, 2023
These devices are not useful or used. Modern Linux distros handle device management using network manager or related infrastructure.
romarowski commentedon Apr 18, 2023
ok, but I need bond0 to verify my MATLAB license,
zer0-memory commentedon Apr 18, 2023
Same here
shemminger commentedon Apr 18, 2023
Then make a dummy bond device with command line or with /etc/network/interfaces.