Perte de connectivité sous WSL2
Par exemple APT merde à se mettre à jour, mais un ping vers un DNS publique passe :
root@Windows:~/proxmark3# apt update Ign:1 http://deb.debian.org/debian bookworm InRelease Ign:2 http://security.debian.org/debian-security bookworm-security InRelease Ign:3 http://ftp.debian.org/debian bookworm-backports InRelease … W: Failed to fetch http://ftp.debian.org/debian/dists/bookworm-backports/InRelease
Temporary failure resolving ‘ftp.debian.org’ W: Some index files failed to download.
They have been ignored, or old ones used instead.
root@Windows:~/proxmark3#
root@Windows:~/proxmark3# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data. 64 bytes from 1.1.1.1: icmp_seq=1 ttl=56 time=10.2 ms ^C
— 1.1.1.1 ping statistics — 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 10.196/10.196/10.196/0.000 ms
root@Windows:~/proxmark3#
Comprendre l’erreur dans WSL2 :
Le ping vers 1.1.1.1 passe = réseau OK -> Le souci vient du DNS.
Sous WSL2 Windows s'amuse à rajouter une couche DNS avec un résolveur local foireux sur 127.0.0.53 !!!
root@Windows:~/proxmark3# cat /etc/resolv.conf
Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) DO NOT EDIT THIS FILE BY HAND – YOUR CHANGES WILL BE OVERWRITTEN 127.0.0.53 is the systemd-resolved stub resolver. run “resolvectl status” to see details about the actual nameservers.
root@Windows:~/proxmark3#
C’est le cas typique où WSL fout un systemd-resolved moisi avec un DNS local foireux (127.0.0.53). Résultat : résolution cassée inside WSL. On corrige ça à la bourrin mais propre.
Fix permanent :
Supprimer le lien /etc/resolv.conf actuel (c’est pas un vrai fichier) :
rm -f /etc/resolv.conf
Créer un nouveau fichier statique :
echo “nameserver 1.1.1.1” > /etc/resolv.conf
Locker le fichier pour empêcher WSL de le réécrire :
chattr +i /etc/resolv.conf
Tester :
ping -c 1 deb.debian.org