2024-08-08 20:02:57 +02:00
|
|
|
{ ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
networking.vlans."enp1s0.205" = {
|
|
|
|
id = 205;
|
|
|
|
interface = "enp1s0";
|
|
|
|
};
|
|
|
|
networking.bridges."net-iot".interfaces = [
|
|
|
|
"enp1s0.205"
|
|
|
|
];
|
|
|
|
networking.interfaces."net-iot".ipv6.addresses = [
|
|
|
|
{ address = "fe80::1"; prefixLength = 64; }
|
|
|
|
{ address = "fd00:152:152:205::1"; prefixLength = 64; }
|
|
|
|
];
|
|
|
|
networking.interfaces."net-iot".ipv4.addresses = [
|
|
|
|
{ address = "10.152.205.1"; prefixLength = 24; }
|
|
|
|
];
|
|
|
|
|
2024-08-09 18:02:48 +02:00
|
|
|
# Enable NTP
|
|
|
|
networking.firewall.interfaces."net-iot".allowedUDPPorts = [ 123 ];
|
|
|
|
|
2024-08-08 20:02:57 +02:00
|
|
|
services.radvd.config = ''
|
|
|
|
interface net-iot {
|
|
|
|
AdvSendAdvert on;
|
2024-11-10 19:52:47 +01:00
|
|
|
MaxRtrAdvInterval 30;
|
2024-08-15 19:40:37 +02:00
|
|
|
prefix ::/64 {
|
2024-11-10 19:52:47 +01:00
|
|
|
AdvValidLifetime 300;
|
|
|
|
AdvPreferredLifetime 120;
|
2024-08-15 19:40:37 +02:00
|
|
|
};
|
2024-08-08 20:02:57 +02:00
|
|
|
RDNSS fd00:152:152::1 {};
|
|
|
|
DNSSL iot.clerie.de {};
|
|
|
|
};
|
|
|
|
'';
|
|
|
|
|
|
|
|
services.kea.dhcp4 = {
|
|
|
|
settings = {
|
|
|
|
interfaces-config = {
|
|
|
|
interfaces = [ "net-iot" ];
|
|
|
|
};
|
|
|
|
subnet4 = [
|
|
|
|
{
|
|
|
|
id = 205;
|
|
|
|
subnet = "10.152.205.0/24";
|
|
|
|
pools = [
|
|
|
|
{
|
|
|
|
pool = "10.152.205.100 - 10.152.205.240";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
option-data = [
|
|
|
|
{
|
|
|
|
name = "routers";
|
|
|
|
data = "10.152.205.1";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "domain-name-servers";
|
|
|
|
data = "10.152.0.1";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "domain-name";
|
|
|
|
data = "iot.clerie.de";
|
|
|
|
}
|
2024-08-09 18:02:48 +02:00
|
|
|
{
|
|
|
|
name = "time-servers";
|
|
|
|
data = "10.152.0.1";
|
|
|
|
}
|
2024-08-08 20:02:57 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
clerie.firewall.extraForwardFilterCommands = ''
|
|
|
|
# Allow access from Heimnetz to IOT devices
|
|
|
|
ip46tables -A forward-filter -i net-heimnetz -o net-iot -j ACCEPT
|
|
|
|
ip46tables -A forward-filter -i net-iot -j DROP
|
|
|
|
ip46tables -A forward-filter -o net-iot -j DROP
|
|
|
|
'';
|
|
|
|
|
|
|
|
}
|