liminix/tests/pppoe/configuration.nix

46 lines
1.1 KiB
Nix
Raw Permalink Normal View History

{ config, pkgs, lib, ... } :
2022-09-25 12:54:31 +02:00
let
inherit (pkgs.liminix.services) oneshot longrun bundle target output;
2023-09-01 18:55:08 +02:00
svc = config.system.service;
2022-09-25 12:54:31 +02:00
in rec {
2023-09-01 18:55:08 +02:00
services.lan4 = svc.network.address.build {
interface = config.hardware.networkInterfaces.lan;
family = "inet"; address ="192.168.19.1"; prefixLength = 24;
};
2023-07-14 23:23:11 +02:00
imports = [
../../modules/ppp
2023-07-14 23:53:25 +02:00
../../modules/dnsmasq
2023-09-01 18:55:08 +02:00
../../modules/network
2023-07-14 23:23:11 +02:00
];
2022-09-25 12:54:31 +02:00
services.pppoe =
2023-09-01 18:55:08 +02:00
svc.pppoe.build {
interface = config.hardware.networkInterfaces.wan;
ppp-options = [
"debug" "+ipv6" "noauth"
"name" "db123@a.1"
"password" "NotReallyTheSecret"
];
};
2022-09-25 12:54:31 +02:00
2023-09-01 18:55:08 +02:00
services.defaultroute4 = svc.network.route.build {
via = "$(output ${services.pppoe} address)";
2022-09-26 13:55:10 +02:00
target = "default";
dependencies = [ services.pppoe ];
};
2023-09-01 18:55:08 +02:00
services.packet_forwarding = svc.network.forward.build {
dependencies = [services.pppoe];
};
2022-09-25 12:54:31 +02:00
services.dns =
2023-09-01 18:55:08 +02:00
svc.dnsmasq.build {
interface = services.lan4;
ranges = ["192.168.19.10,192.168.19.253"];
domain = "fake.liminix.org";
};
defaultProfile.packages = [ pkgs.hello ] ;
2022-09-25 12:54:31 +02:00
}