Oracle Free Tier Networking Problems

Overview

Hello, I have used an Oracle Free Tier instance to host a few services for a while now (under Ubuntu), but decided I would rather re-install the OS with NixOS so I can manage the VPS more easily and along with my other NixOS installs.

In order to install NixOS (because Oracle does not provide a NixOS image), I have been trying to use GitHub - nix-community/nixos-anywhere: Install NixOS everywhere via SSH [maintainers=Mic92, Lassulus, phaer, Enzime] in order to install NixOS ontop of a blank Oracle image. After lots of trial and error, I am now able to get NixOS mostly installed on the VPS with my configuration (located at nix/nixos/hosts/oracle-vps at main - tyy/nix - Codeberg.org). Over oracle’s web console, I can properly login to my user account and see my system configuration has applied properly.

The problem

However, no matter what I do, I cannot get the VPS to properly connect to the internet. Hypothetically, all I should need is to get systemd-networkd to use DHCP over the singular ethernet port, but it can’t seem to get an address properly. Even if I statically configure the interface with the 10.0.0.145/24 address oracle claims my VPS should have, any packets sent over the interface get dropped with Destination Host Unreachable. When DHCP is enabled, I can see systemd-networkd in the logs attempting to contact the server, but receiving no response.

At first I assumed it might be a driver issue, as that might explain why packets never seem to make it out of the interface. However, after getting the name of the driver while booted into an Ubuntu image, and force loading it in my nixos configuration, nothing changed. For context, I tried both using nixos-facter and the standard nixos-generate-config methods (generated automatically by nixos-anywhere), and neither seems to get NixOS to connect to the internet. I even attempted using the web console to open UEFI menu with systemd-boot (which did have network-related options), but messing with it appeared to change nothing.

So, my main question is this: does anyone know what the issue might be, and/or how I can possibly debug this? I tried all I could think of and yet the machine can still inexplicably not connect to the internet.

I use the config below for my free VPS, it works fine. Never got IPv6 to work, sadly.

  networking = {
    defaultGateway = "10.0.0.1";
    interfaces.eth0 = {
      ipv4.addresses = [
        {
          address = "10.0.0.90";
          prefixLength = 24;
        }
      ];
      useDHCP = false;
    };
    firewall = {
      logRefusedConnections = false;
      rejectPackets = true;
    };
  };

I tried copying that configuration, and it still wasn’t working.

However, out of pure luck I tried deleting the bridge network configuration I had setup (for containers) and restarting the networking, and magically everything started working again. Turns out I had my bridge network improperly configured and that was preventing all of my routing from functioning properly :​/

After fixing that in my nix configuration, now everything works.