2025-02-10 21:55:08 +00:00
|
|
|
{ config, pkgs, ... }:
|
2022-09-25 10:54:31 +00:00
|
|
|
let
|
2024-06-29 21:59:27 +00:00
|
|
|
inherit (pkgs.liminix.services) target;
|
2023-09-01 16:55:08 +00:00
|
|
|
svc = config.system.service;
|
2025-02-10 21:55:08 +00:00
|
|
|
in
|
|
|
|
rec {
|
2023-09-01 16:55:08 +00:00
|
|
|
services.lan4 = svc.network.address.build {
|
|
|
|
interface = config.hardware.networkInterfaces.lan;
|
2025-02-10 21:55:08 +00:00
|
|
|
family = "inet";
|
|
|
|
address = "192.168.19.1";
|
|
|
|
prefixLength = 24;
|
2023-09-01 16:55:08 +00:00
|
|
|
};
|
2022-09-28 20:33:18 +00:00
|
|
|
|
2023-07-14 21:23:11 +00:00
|
|
|
imports = [
|
|
|
|
../../modules/ppp
|
2023-07-14 21:53:25 +00:00
|
|
|
../../modules/dnsmasq
|
2023-09-01 16:55:08 +00:00
|
|
|
../../modules/network
|
2025-02-25 23:32:05 +00:00
|
|
|
../../modules/firewall
|
2023-07-14 21:23:11 +00:00
|
|
|
];
|
2022-09-25 20:12:23 +00:00
|
|
|
|
2025-02-10 21:55:08 +00:00
|
|
|
services.pppoe = svc.pppoe.build {
|
|
|
|
interface = config.hardware.networkInterfaces.wan;
|
|
|
|
username = "db123@a.1";
|
|
|
|
password = "NotReallyTheSecret";
|
|
|
|
};
|
2022-09-25 10:54:31 +00:00
|
|
|
|
2025-02-25 23:32:05 +00:00
|
|
|
services.firewall = svc.firewall.build {
|
|
|
|
zones = {
|
|
|
|
wan = [ services.pppoe ];
|
|
|
|
lan = [ services.lan4 ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-09-01 16:55:08 +00:00
|
|
|
services.defaultroute4 = svc.network.route.build {
|
2022-10-02 15:35:55 +00:00
|
|
|
via = "$(output ${services.pppoe} address)";
|
2022-09-26 11:55:10 +00:00
|
|
|
target = "default";
|
|
|
|
dependencies = [ services.pppoe ];
|
|
|
|
};
|
|
|
|
|
2023-09-01 16:55:08 +00:00
|
|
|
services.packet_forwarding = svc.network.forward.build {
|
2025-02-10 21:55:08 +00:00
|
|
|
dependencies = [ services.pppoe ];
|
2023-09-01 16:55:08 +00:00
|
|
|
};
|
2022-09-25 10:54:31 +00:00
|
|
|
|
2025-02-10 21:55:08 +00:00
|
|
|
services.dns = svc.dnsmasq.build {
|
|
|
|
interface = services.lan4;
|
|
|
|
ranges = [ "192.168.19.10,192.168.19.253" ];
|
|
|
|
domain = "fake.liminix.org";
|
|
|
|
};
|
2022-09-28 20:33:18 +00:00
|
|
|
|
2025-02-25 23:32:05 +00:00
|
|
|
defaultProfile.packages = with pkgs; [ nftables hello ];
|
2022-09-25 10:54:31 +00:00
|
|
|
}
|