I’ve just installed a NixOS server on a Linode, and I’m finding that everything I try to use some kind of SSH connection alongside a domain name takes many minutes before the connection succeeds. For instance:
ssh connection to another server (IP address works fine to the same server)
pulling git repositories from github
I’ve tried the various tests from Dns resolving very slow and I don’t think it has anything to do with DNS resolution as that all happens quickly, and using wget on a file to download from github works fast.
This slowness appears to also affect hosting a page with nginx, as a web browser times out trying to access the site.
As far as I can tell, these are the appropriate parts of my configuration.nix
# Taken from Linode https://www.linode.com/docs/guides/install-nixos-on-linode/#disable-predictable-interface-names
networking.usePredictableInterfaceNames = false;
networking.useDHCP = false;
networking.interfaces.eth0.useDHCP = true;
# Services
services.openssh.enable = true;
services.fail2ban.enable = true;
services.locate.enable = true;
# State Version
system.stateVersion = "23.05";
Does anyone have any thoughts on how to debug this? Any help is extremely appreciated!
It seems that IPv6 isn’t working. I’ve just tested it on connecting to another server of mine (v4 vs v6) and v6 doesn’t work.
The question now is… why?. My other server hosted by Linode works perfectly fine with IPv6 (on Arch), and just to be sure I added networking.enableIPv6 = true; to my configuration. ip address in the terminal matches the IPv6 address with what’s on record via Linode.
As a side note (maybe related or not), it seems that I needed to reconfigure the firewall to add in the 80 port on TCP to get nginx working - seems it was a separate issue (maybe).
Linode is pretty particular about how you configure things. You may want to set up static networking. Here’s my config with systemd-networkd, check the Linode docs on what your DNS servers, address, gateway and whatnot should be:
That’s what I ended up doing. (Of course, this is my desktop, not a linode server.) I had to learn up a bit about networking and DHCP before I could figure out the quirk in my ethernet router. But the solution to my particular problem was that I had to provide alternate gateways, and now everything works.