I’m trying to install NixOS on a a new machine, but I’m running into some networking issues that I haven’t ran into before. On the surface it looks like I’m having some DNS issues, but I think it’s deeper than that. For example, when I ping google.com, after a long wait I get ping: google.com: Temporary failure in name resolution. However, when I ping 8.8.8.8 to try work around DNS, I get a crazy level of packet loss (sometimes up to 100%, at minimum 70%). To contrast, on my laptop (from which I’m typing this) I get 0% packet loss. In addition to the above, ssh traffic over my local network from my laptop to the new machine is so unreliable I cannot even log in. Fetching the host key using ssh-keyscan took multiple attempts.
I’m not that well-versed in this kind of networking, so I’m not sure where to look. One thing to note is that when I use the live NixOS installation media (the GNOME edition), I can connect to my WiFi network just fine, so it doesn’t seem to be a hardware issue. On the NixOS configuration side, I tried both NetworkManager (networking.networkmanager.enable = true; with nmtui) and networking.wireless.enable = true with networking.wireless.networks."SSID".psk = "hunter2"; (but never both enabled at the same time). Both result in the same issues I described above. I tried taking a look at the output of ip route, but (to my untrained eye) this looks OK and similar to the output on my (Fedora) laptop. I’m using the wpa_supplicant configuration on a NixOS Raspberry Pi without problems.
I’m not sure how to continue troubleshooting this so I’m reaching out to you. I appreciate any and all pointers. My configuration.nix is still very minimal, containing only the hardware configuration, the networking setup described above (and the hostname), openssh enabling and the state version. If you need more information, let me know
I managed to change the routing table to be exactly like it is on my Fedora laptop (modulo the device’s IP). Still having issues.
In addition, I can more reliably ping my router / default gateway (ping 192.168.1.1) but I still have a 68% packet loss after 78 packets (that means 25 received).
I noticed that the Live CD wasn’t as flawless as I thought; with it I get 10% packet loss over 60 packets (54 received). I verified that on my laptop I received all 60. Both are ping -c 60 8.8.8.8. In any case, that’s still a lot better than I get on the actual install.
Thanks for the suggestion. I was able to fish up an ethernet cable and connect the machine – this works without issues; 0% packet loss. Unfortunately I’m not able to permanently connect the machine with ethernet due to the layout of my apartment, so I’m still looking for a way to fix the WiFi connectivity
I’m not super familiar with networking issues either, but since no one has recommended it yet, I’d try a bunch of different kernel/driver versions. Nixpkgs contains a bunch of different kernel versions. Either a new or older one may work better.
If this is a relatively new device, then the newest kernel/driver version from nixos-unstable might be a good thing to try.