Description
Windows build number: version 2004 Build 19041.264
I've removed all WSL/WSL2 components and Docker before installing only WSL/WSL2. I have the same behaviour on 4 distributions (Ubuntu 18.04/20.04, Debian 10, Kali Linux 2020.1).
All coming lines are from Ubuntu 20.04.
When started, I cannot get any connection. eth0
interface is down and not configured:
ip addr show eth0
4: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:15:5d:3c:76:f7 brd ff:ff:ff:ff:ff:ff
Using ipconfig
from Windows gives me information about needed network configuration:
Ethernet adapter vEthernet (WSL):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::a0cf:c53c:da4:86ef%53
IPv4 Address. . . . . . . . . . . : 172.31.208.1
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . :
I then manually configure eth0
and add a default route:
sudo ip address add 172.31.208.10/20 broadcast 172.31.223.255 dev eth0
sudo ip route add default via 172.31.208.1
Now the interface:
ip addr show eth0
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:3c:76:f7 brd ff:ff:ff:ff:ff:ff
inet 172.31.208.10/20 brd 172.31.223.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fe3c:76f7/64 scope link
valid_lft forever preferred_lft forever
and the route:
ip route
default via 172.31.208.1 dev eth0
172.31.208.0/20 dev eth0 proto kernel scope link src 172.31.208.10
are correct (network connections are working).
What's not working: network is not fully configured
Expected behaviour: have inet fully configured without manual intervention. Also, the network settings change at each reboot, raising the need for this operation after each reboot.