From 6ec5e436a2d5eedff214974c2f2e8c26f14088a3 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 13 Jul 2023 18:25:05 +0800 Subject: [PATCH] nixbld: fix altnet routing --- nixbld-etc-nixos/configuration.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nixbld-etc-nixos/configuration.nix b/nixbld-etc-nixos/configuration.nix index 5908bcc..f722701 100644 --- a/nixbld-etc-nixos/configuration.nix +++ b/nixbld-etc-nixos/configuration.nix @@ -204,6 +204,13 @@ in address = "103.206.98.200"; prefixLength = 29; }]; + ipv4.routes = [ + { + address = "103.206.98.200"; + prefixLength = 29; + options.table = "1"; + } + ]; }; }; boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = "1"; @@ -239,7 +246,7 @@ in serviceConfig = { Type = "oneshot"; RemainAfterExit = true; - ExecStart = "${pkgs.iproute2}/bin/ip rule add from 103.206.98.200/29 table 1"; + ExecStart = "${pkgs.iproute2}/bin/ip rule add from 103.206.98.0/24 table 1"; ExecStop = "${pkgs.iproute2}/bin/ip rule del table 1"; }; };