Networking (DNS?) issues on fresh install

Hey there,

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 :slight_smile:

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).

nmcli d show wlp2s0 also shows everything as expected:

GENERAL.DEVICE:                         wlp2s0
GENERAL.TYPE:                           wifi
GENERAL.HWADDR:                         <snip>
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     <SSID>
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/6
IP4.ADDRESS[1]:                         192.168.1.100/24
IP4.GATEWAY:                            192.168.1.1
IP4.ROUTE[1]:                           dst = 0.0.0.0/0, nh = 192.168.1.1, mt = 600
IP4.ROUTE[2]:                           dst = 192.168.1.0/24, nh = 0.0.0.0, mt = 600
IP4.DNS[1]:                             192.168.1.1
IP4.DOMAIN[1]:                          <snip>.local
IP6.ADDRESS[1]:                         <snip>
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 600

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.

Any chance you could try Ethernet to rule out hardware issues?

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 :crossed_fingers:

The device is an Intel dual band wireless AC 3168NGW Stone Peak, which looks to be problematic for other people as well given a quick Google search.

1 Like

Hm, yeah, sounds like a hardware/driver issue indeed :expressionless: I assume you’ve dug through dmesg already? The DNS failures may well be caused by packet drops.

As far as nixos specific advice goes, check the hardware repo: GitHub - NixOS/nixos-hardware: A collection of NixOS modules covering hardware quirks.. If there’s no config for your device yet, consider adding one if you figure out a fix.

1 Like

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.

1 Like