Is ipset the right tool to allow traffic to a specific set of domains on an interface that does not have WAN access by default?
Here is the relevant setup in /etc/config/firewall:
...
config zone
option name 'iot'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
list network 'iot'
config rule
option src 'iot'
option target 'ACCEPT'
list proto 'tcp'
list proto 'udp'
option dest_port '53 67 68'
option name 'iot dhcp dns'
option family 'ipv4'
config rule 'fwd_filter'
option name 'Filter-IPset-DNS-Forward'
option src 'iot'
option dest 'wan'
option family 'ipv4'
option ipset 'allowtraffic'
option target 'ACCEPT'
list proto 'all'
The ipset definition is present:
# tail /etc/config/dhcp
...
config ipset
list name 'allowtraffic'
list domain 'ipinfo.io'
list domain 'pushx.reolink.com'
option table_family 'ip'
But devices connected that the iot interface cannot connect to either of the domains defined in the ipset rule.
Are you running an up-to-date version of OpenWRT (with nftables rather than iptables)?
If so, then ipset is no longer a thing. You can either add the relevant definition to the firewall config by hand, or there should be a tab for 'IP Sets' on the firewall page in Luci.
Yes, it is a snapshot I built today. I see the section under Network>Firewall>IP Sets. Is this where I define a reference to the config ipset I created in /etc/config/dhcp somehow?
# tail /etc/config/dhcp
...
config ipset
list name 'allowtraffic'
list domain 'ipinfo.io'
list domain 'pushx.reolink.com'
Here is the dialog under Network>Firewall>IP Sets>Add
Yes. As I understand it the two are referenced by name so that looks fine.
Leave the IPs/Networks/MACs blank. That adds static values to the set.
And Packet Field Match should be dest_ip.
If you needed to cover both IPv4 and IPv6 addresses then (afaik) you'd need to add another IP set in the firewall, but the entry in the /etc/config/dhcp can cover both by adding another list name line.
I have it setup but am unable to connect to the domain ipinfo.io I setup in /etc/config/dhcp.
Is there some obvious flaw in these entries?
# tail /etc/config/dhcp
...
config ipset
list name 'allowtraffic'
list domain 'ipinfo.io'
list domain 'pushx.reolink.com'
And
# tail /etc/config/firewall
...
config rule 'fwd_filter'
option name 'Filter-IPset-DNS-Forward'
option src 'iot'
option dest 'wan'
option family 'ipv4'
option target 'ACCEPT'
list proto 'tcp'
option dest_port '80 443'
option ipset 'allowtraffic'
config ipset
option name 'allowtraffic'
option family 'ipv4'
list match 'dest_ip'