I'd like to restrict a smart thermostat on my IoT VLAN. I setup two traffic rules:
udp/53 from it's IP to my pi-hole box
tcp/443 and 80 to WAN
Even with these two, the device claims to offline/cannot connect to the internet. Any thoughts on what else I need to open up?
Note that if I temporarily change my IoT zone's "Allow forward to destination zones" policy from "unspecified" to "WAN" the thermostat immediately goes into "connected/online" mode.
It almost certainly depends on the specific brand/model thermostat. There are so many ways that these things can work, so the best option would be to provide full access to the internet and then monitor the connections it makes.
Look at the PiHole's responses here -- in the event that PiHole has blocked any of the domains that your thermostat uses, it would cause DNS failures and thus the device would think it is offline. You may need to allow list certain domains in that context.
This assumes that it uses those ports for connection to some service (such as a cloud service or other)... this may or may not be the right set of ports.
Also keep in mind that just restricting ports doesn't necessarily restrict what can be done/sent over those ports.
Let's take a look at your complete firewall file to understand how you have attempted to create these rules.
I'll spare you the complete one and just show the two rules unless you think there value in see the entire one:
/etc/config/firewall
config rule
list proto 'udp'
option src 'iot'
option dest 'lxc'
option dest_port '53'
option target 'ACCEPT'
option family 'ipv4'
option name 'IoT DNS whitelist'
list src_ip '10.9.5.107'
config rule
option name 'thermostat'
list proto 'tcp'
option src 'iot'
option dest 'wan'
option target 'ACCEPT'
option dest_port '443 80'
list src_ip '10.9.5.107'
option family 'ipv4'
I have the entire IOT zone forwarding to REJECT so no access by default. I don't think a traffic rule is needed, no?
I believe these are queries found by searching for the device in pi-hole's long-term data filtered by hostname. No sure how to see connections vs queries.
Good question! I have this rule a bit further up in my /etc/config/firewall which allows it:
config rule
option src 'iot'
option target 'ACCEPT'
list proto 'tcp'
list proto 'udp'
option dest_port '53 67 68 123'
option name 'iot dhcp dns and ntpd'
option family 'ipv4'