Skip to content

Commit

Permalink
checks/iperf: perform network configuration with systemd-networkd
Browse files Browse the repository at this point in the history
for it being less dependending on interface names
  • Loading branch information
astro committed Jan 8, 2024
1 parent 705da66 commit 3132b6a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions checks/iperf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ nixpkgs.lib.optionalAttrs (builtins.elem hypervisor self.lib.hypervisorsWithNetw
name = "vm-${hypervisor}-iperf";
nodes.vm = {
imports = [ self.nixosModules.host ];
# TODO: this is a farce of a flake. replace with declarative
# microvm.
microvm.vms."${hypervisor}-iperf-server".flake = nixpkgs.legacyPackages.${system}.runCommand "${hypervisor}-iperf-server.flake" {
passthru.nixosConfigurations."${hypervisor}-iperf-server" = nixpkgs.lib.nixosSystem {
inherit system;
Expand All @@ -21,16 +23,14 @@ nixpkgs.lib.optionalAttrs (builtins.elem hypervisor self.lib.hypervisorsWithNetw
} ];
};
networking.hostName = "${hypervisor}-microvm";
networking = {
interfaces.eth0 = {
useDHCP = false;
ipv4.addresses = [ {
address = "10.0.0.1";
prefixLength = 24;
} ];
systemd.network = {
enable = true;
networks."10-eth" = {
matchConfig.Type = "ether";
address = [ "10.0.0.1/24" ];
};
firewall.enable = false;
};
networking.firewall.enable = false;
services.iperf3.enable = true;
}
];
Expand Down

0 comments on commit 3132b6a

Please sign in to comment.