feat: dns for vlans

This commit is contained in:
Patrick 2024-12-21 20:57:16 +01:00
parent 5d1bc8cf67
commit 9347751df7
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
2 changed files with 15 additions and 23 deletions

View file

@ -1,4 +1,9 @@
{ config, ... }: {
config,
lib,
globals,
...
}:
{ {
wireguard.services = { wireguard.services = {
client.via = "nucnix"; client.via = "nucnix";
@ -30,11 +35,9 @@
]; ];
}; };
user_rules = [ user_rules = [
# "||adguardhome.${config.secrets.secrets.global.domains.web}^$dnsrewrite=${lib.net.cidr.host config.secrets.secrets.global.net.ips.elisabeth config.secrets.secrets.global.net.privateSubnetv4}" "||${globals.domains.web}^$dnsrewrite=${lib.net.cidr.host globals.services.nginx.ip globals.net.vlans.home.cidrv4}"
# "||nc.${config.secrets.secrets.global.domains.web}^$dnsrewrite=${lib.net.cidr.host config.secrets.secrets.global.net.ips.elisabeth config.secrets.secrets.global.net.privateSubnetv4}" "||${globals.services.samba.domain}^$dnsrewrite=${lib.net.cidr.host globals.services.samba.ip globals.net.vlans.home.cidrv4}"
# "||immich.${config.secrets.secrets.global.domains.web}^$dnsrewrite=${lib.net.cidr.host config.secrets.secrets.global.net.ips.elisabeth config.secrets.secrets.global.net.privateSubnetv4}" "||fritz.box^$dnsrewrite=${lib.net.cidr.host 1 "10.99.2.0/24"}"
# "||smb.${config.secrets.secrets.global.domains.web}^$dnsrewrite=${lib.net.cidr.host config.secrets.secrets.global.net.ips.elisabeth-samba config.secrets.secrets.global.net.privateSubnetv4}"
# "||fritz.box^$dnsrewrite=${lib.net.cidr.host 1 config.secrets.secrets.global.net.privateSubnetv4}"
]; ];
dhcp.enabled = false; dhcp.enabled = false;
ratelimit = 60; ratelimit = 60;

View file

@ -1,7 +1,9 @@
{ {
lib, lib,
utils, utils,
globals,
... ...
}: }:
let let
inherit (lib) inherit (lib)
@ -55,30 +57,17 @@ in
} }
{ {
name = "domain-name-servers"; name = "domain-name-servers";
data = "${net.cidr.host 10 subnet}"; data = "${net.cidr.host globals.services.adguardhome.ip subnet}";
} }
]; ];
reservations = [ reservations = [
#FIXME
# {
# hw-address = nodes.ward-adguardhome.config.lib.microvm.mac;
# ip-address = globals.net.home-lan.hosts.ward-adguardhome.ipv4;
# }
# {
# hw-address = nodes.ward-web-proxy.config.lib.microvm.mac;
# ip-address = globals.net.home-lan.hosts.ward-web-proxy.ipv4;
# }
# {
# hw-address = nodes.sire-samba.config.lib.microvm.mac;
# ip-address = globals.net.home-lan.hosts.sire-samba.ipv4;
# }
]; ];
} }
); );
}; };
}; };
systemd.services.kea-dhcp4-server.after = [ systemd.services.kea-dhcp4-server.after = flip mapAttrsToList vlans (
"sys-subsystem-net-devices-${utils.escapeSystemdPath "lan-self"}.device" name: _: "sys-subsystem-net-devices-${utils.escapeSystemdPath "lan-${name}"}.device"
]; );
} }