router: setup cameras vlan
All checks were successful
flake / flake (push) Successful in 1m16s

This commit is contained in:
Jake Hillion 2024-09-16 20:48:10 +01:00
parent 1189a41df9
commit e629fc6f92

View File

@ -32,6 +32,14 @@
nat.enable = lib.mkForce false; nat.enable = lib.mkForce false;
useDHCP = false; useDHCP = false;
vlans = {
cameras = {
id = 3;
interface = "eth2";
};
};
interfaces = { interfaces = {
enp1s0 = { enp1s0 = {
name = "eth0"; name = "eth0";
@ -47,6 +55,14 @@
} }
]; ];
}; };
cameras /* cameras@eth1 */ = {
ipv4.addresses = [
{
address = "10.133.145.1";
prefixLength = 24;
}
];
};
enp3s0 = { enp3s0 = {
name = "eth2"; name = "eth2";
ipv4.addresses = [ ipv4.addresses = [
@ -82,8 +98,8 @@
ip protocol icmp counter accept comment "accept all ICMP types" ip protocol icmp counter accept comment "accept all ICMP types"
iifname "eth0" ct state { established, related } counter accept iifname { "eth0", "cameras" } ct state { established, related } counter accept
iifname "eth0" drop iifname { "eth0", "cameras" } drop
} }
chain forward { chain forward {
@ -96,6 +112,9 @@
"eth0", "eth0",
} counter accept comment "Allow trusted LAN to WAN" } counter accept comment "Allow trusted LAN to WAN"
# TODO: remove
iifname "cameras" oifname "eth0" accept
iifname { iifname {
"eth0", "eth0",
} oifname { } oifname {
@ -138,7 +157,7 @@
settings = { settings = {
interfaces-config = { interfaces-config = {
interfaces = [ "eth1" "eth2" ]; interfaces = [ "eth1" "eth2" "cameras" ];
}; };
lease-database = { lease-database = {
type = "memfile"; type = "memfile";
@ -243,6 +262,29 @@
} }
]; ];
} }
{
subnet = "10.133.145.0/24";
interface = "cameras";
pools = [{
pool = "10.133.145.64 - 10.133.145.254";
}];
option-data = [
{
name = "routers";
data = "10.133.145.1";
}
{
name = "broadcast-address";
data = "10.133.145.255";
}
{
name = "domain-name-servers";
data = "1.1.1.1, 8.8.8.8";
}
];
reservations = [
];
}
]; ];
}; };
}; };