mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
feat: allow several discovery protocols in hass
This commit is contained in:
parent
0edc440f81
commit
bb75070da9
2 changed files with 38 additions and 12 deletions
|
@ -27,16 +27,4 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
|
||||
networking.nftables.firewall.rules = {
|
||||
# Allow devices and iot VLANs to access the MQTT server
|
||||
access-mqtt = {
|
||||
from = [
|
||||
"vlan-devices"
|
||||
"vlan-iot"
|
||||
];
|
||||
to = [ "local" ];
|
||||
allowedTCPPorts = [ 1883 ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -104,6 +104,44 @@ in
|
|||
"vlan-${vlanName}".interfaces = [ "vlan-${vlanName}" ];
|
||||
}
|
||||
);
|
||||
|
||||
rules = {
|
||||
# Allow devices to be discovered through various protocols
|
||||
discovery-protocols = {
|
||||
from = [
|
||||
"vlan-home"
|
||||
"vlan-devices"
|
||||
"vlan-iot"
|
||||
];
|
||||
to = [ "local" ];
|
||||
allowedUDPPorts = [
|
||||
1900 # Simple Service Discovery Protocol, UPnP
|
||||
];
|
||||
allowedTCPPorts = [
|
||||
40000 # UPnP HTTP
|
||||
];
|
||||
# HomeKit etc. may use random high-numbered ports.
|
||||
# There's probably a better way to handle this
|
||||
allowedUDPPortRanges = [
|
||||
{
|
||||
from = 30000;
|
||||
to = 65535;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Allow devices to access some local services
|
||||
access-services = {
|
||||
from = [
|
||||
"vlan-devices"
|
||||
"vlan-iot"
|
||||
];
|
||||
to = [ "local" ];
|
||||
allowedTCPPorts = [
|
||||
1883 # MQTT
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
wireguard.proxy-home.client.via = "ward";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue