Using dnsmasq static reservation tags to dynamically modify ipsets?

I have been trying to use the “freeform tags” that can be attached to static reservations to build and modify dynamic ipsets based on the tags given to my local clients.

Currently running:

OpenWrt 24.10.2 r28739-d9340319c6 / LuCI openwrt-24.10 branch 25.217.58566~00c4c12

I tried this config in /etc/config/dhcp:

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option cachesize '0'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option localservice '1'
        option ednspacket_max '1232'
        list ipset '/ANDROID.TEST/ANDROID_DEVICES'

in /etc/config/firewall :

config ipset
        option name 'ANDROID_DEVICES'
        option family 'ipv4'
        list match 'src_ip'

and have my phone tagged with ANDROID.TEST

I then proceeded to

/etc/init.d/firewall reload

rm /tmp/dhcp.leases
/etc/init.d/dnsmasq restart

while my phone was disconnected from the network and then reconnected it, but I am not getting its ip added to the ANDROID_DEVICES ipset located under NETWORK > FIREWALL > IPSETS

Can someone help me understand this stuff? I was trying to mostly stick to the GUI and “built-in” methods before resorting to straight up linux scripts that parse and modify text files manually.

Ipset only populates from dns resolution.

Ref https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.