Fix GRE tunnels restarted before udev service started #56

Merged
sb10q merged 1 commits from esavkin/it-infra:34-network-addr-service-fix into master 2025-01-15 09:54:40 +08:00
Owner

This patch adds explicit requirements for virtual network address services to run after and only when udevd service is running. Also depend on virt netdev creation service instead of device.

Tested by adding following to the defenestrate configuration:

networking.greTunnels."testGreTun" = {
      dev = "enp1s0";
      remote = "103.206.98.8";
      local = "192.168.122.75";
      ttl = 255;
      type = "tun";
    };
    networking.interfaces."testGreTun" = {
      ipv4.addresses = [
        {
          address = "10.47.8.1";
          prefixLength = 31;
        }
      ];
      ipv4.routes = [
        {
          address = "0.0.0.0";
          prefixLength = 0;
          via = "10.47.8.0";
          options.table = "3";
        }
      ];
    };
    systemd.services."network-addresses-testGreTun" = {
      after = pkgs.lib.mkOverride 1 [ "network-pre.target" "testGreTun-netdev.service" "systemd-udevd.service"  ];
      requires = [ "systemd-udevd.service"  ];
  };

and in flake.nix switching inputs.nixpkgs.url = github:NixOS/nixpkgs/ between 1dab772dd4a68a7bba5d9460685547ff8e17d899 and fddbd3e9800c214f83674791a883716c168a8539 back and forth.
Also checked that changing the interface parameters happens without errors.

This patch adds explicit requirements for virtual network address services to run after and only when udevd service is running. Also depend on virt netdev creation service instead of device. Tested by adding following to the defenestrate configuration: ```nix networking.greTunnels."testGreTun" = { dev = "enp1s0"; remote = "103.206.98.8"; local = "192.168.122.75"; ttl = 255; type = "tun"; }; networking.interfaces."testGreTun" = { ipv4.addresses = [ { address = "10.47.8.1"; prefixLength = 31; } ]; ipv4.routes = [ { address = "0.0.0.0"; prefixLength = 0; via = "10.47.8.0"; options.table = "3"; } ]; }; systemd.services."network-addresses-testGreTun" = { after = pkgs.lib.mkOverride 1 [ "network-pre.target" "testGreTun-netdev.service" "systemd-udevd.service" ]; requires = [ "systemd-udevd.service" ]; }; ``` and in flake.nix switching `inputs.nixpkgs.url = github:NixOS/nixpkgs/` between 1dab772dd4a68a7bba5d9460685547ff8e17d899 and fddbd3e9800c214f83674791a883716c168a8539 back and forth. Also checked that changing the interface parameters happens without errors.
esavkin added 1 commit 2025-01-14 16:46:52 +08:00
This patch adds explicit requirements for network addresses services to run after and only when udevd service is running. Also depend on virt netdev creation service instead of device

Signed-off-by: Egor Savkin <es@m-labs.hk>
sb10q merged commit 0e62d0a78a into master 2025-01-15 09:54:40 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/it-infra#56
No description provided.