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 = {
client.via = "nucnix";
@ -30,11 +35,9 @@
];
};
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}"
# "||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}"
# "||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}"
# "||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}"
"||${globals.domains.web}^$dnsrewrite=${lib.net.cidr.host globals.services.nginx.ip globals.net.vlans.home.cidrv4}"
"||${globals.services.samba.domain}^$dnsrewrite=${lib.net.cidr.host globals.services.samba.ip globals.net.vlans.home.cidrv4}"
"||fritz.box^$dnsrewrite=${lib.net.cidr.host 1 "10.99.2.0/24"}"
];
dhcp.enabled = false;
ratelimit = 60;

View file

@ -1,7 +1,9 @@
{
lib,
utils,
globals,
...
}:
let
inherit (lib)
@ -55,30 +57,17 @@ in
}
{
name = "domain-name-servers";
data = "${net.cidr.host 10 subnet}";
data = "${net.cidr.host globals.services.adguardhome.ip subnet}";
}
];
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 = [
"sys-subsystem-net-devices-${utils.escapeSystemdPath "lan-self"}.device"
];
systemd.services.kea-dhcp4-server.after = flip mapAttrsToList vlans (
name: _: "sys-subsystem-net-devices-${utils.escapeSystemdPath "lan-${name}"}.device"
);
}