checks: add stub-roa

This commit is contained in:
Astro 2024-04-13 01:14:58 +02:00
parent 412149e223
commit 025898329e
3 changed files with 35 additions and 5 deletions

View File

@ -1,8 +1,8 @@
{ pkgs ? import <nixpkgs> { } }:
{ self, pkgs ? import <nixpkgs> { } }:
let
common = { pkgs, ... }: {
imports = [ ../modules ];
imports = [ self.nixosModules.default ];
networking.dn42.enable = true;
virtualisation.interfaces.enp1s0.vlan = 1;
networking.useNetworkd = true;
@ -12,6 +12,20 @@ let
Name = "dummy0";
};
environment.systemPackages = [ pkgs.jq ];
services.dn42-roagen = {
enable = true;
outputDir = pkgs.runCommand "stub-roa" {} ''
mkdir $out
cat >$out/dn42-roa4.conf <<EOF
route 172.20.0.0/24 max 24 as 64600;
route 172.20.1.0/24 max 24 as 64601;
EOF
cat >$out/dn42-roa6.conf <<EOF
route fec1::/64 max 64 as 64600;
route fec1:0:0:1::/64 max 64 as 64601;
EOF
'';
};
};
in

View File

@ -1,8 +1,8 @@
{ pkgs ? import <nixpkgs> { } }:
{ self, pkgs ? import <nixpkgs> { } }:
let
common = { pkgs, ... }: {
imports = [ ../modules ];
common = { config, pkgs, ... }: {
imports = [ self.nixosModules.default ];
networking.dn42.enable = true;
virtualisation.interfaces.enp1s0.vlan = 1;
networking.useNetworkd = true;
@ -12,6 +12,20 @@ let
Name = "dummy0";
};
environment.systemPackages = [ pkgs.jq ];
services.dn42-roagen = {
enable = true;
outputDir = pkgs.runCommand "stub-roa" {} ''
mkdir $out
cat >$out/dn42-roa4.conf <<EOF
route 172.20.0.0/24 max 24 as 64600;
route 172.20.1.0/24 max 24 as 64601;
EOF
cat >$out/dn42-roa6.conf <<EOF
route fec1::/64 max 64 as 64600;
route fec1:0:0:1::/64 max 64 as 64601;
EOF
'';
};
};
in

View File

@ -21,9 +21,11 @@
name = system;
value = {
two-peers = import ./checks/two-peers.nix {
inherit self;
pkgs = nixpkgs.legacyPackages.${system};
};
extended-next-hop = import ./checks/extended-next-hop.nix {
inherit self;
pkgs = nixpkgs.legacyPackages.${system};
};
};