Hello,
I use tags in dnsmasq configuration for adding specific DCHP options to static leases.
I can assign existing freeform tags to static leases form the web page, but I have to add the tags manually in the configuration.
So, it would be nice if there was a way for adding/ removing/ editing tags using the DHCP and DNS configuration web page, instead of having to add them using uci or by manually editing the /etc/config/dhcp file.
I apologize as I don't intend to take this thread away from your request, but I was not aware of this functionality and I have a question if you don't mind.
Do these tags allow you to send out DHCP Option 6 to certain clients for specific DNS addresses, while sending out another DHCP Option 6 to other clients for specific DNS addresses?
I spent some time reading the dnsmasq manpage after seeing your post here. But I have to admit, I feel confused about it to a certain extent. If you could possibly share a couple of snippets/examples of how you use it, that would be appreciated. Thank you.
you add a tag with the dhcp option you want in the configuration
ex.
subnet mask 255.255.255.0 , gateway 192.168.151.10, dns servers 192.168.151.10 and 192.168.151.11
config tag 'net2'
list dhcp_option '1,255.255.255.0'
list dhcp_option '3,192.168.151.10'
list dhcp_option '6,192.168.151.10,192.168.151.11'
route 192.168.1.0/24 -> 192.168.151.10 and route 192.168.124.34/32 -> 192.168.151.11
config tag 'route3'
list dhcp_option '121,192.168.1.0/24,192.168.151.10,192.168.124.34/32,192.168.151.11'
and then in the web interface you add these two tags, net2 and route3 (both or one of them) to the static leases/hosts/clients you want to use them and for example the hosts configuration looks like this:
config host
option name 'testPC2'
option mac '12:34:56:78:9a:bc'
option ip '192.168.151.61'
option leasetime '12h'
list tag 'net2'
list tag 'route3'
The second part, adding tags to the host already works from the web gui.
The first part, creating the tag does not work from the web gui, this is what i asked for.
Thank you so much, I appreciate it. Seeing your examples in OpenWrt-specific dhcp config format definitely helps me understand it much better now. This is fantastic. Lots of possibilities with tags which is great.
I would also like to second your feature request. I think having this functionality within LuCI to manage tags better would be good to have.
This is something I've been working on for a while. The work must be done in small steps, otherwise reviewers just get overwhelmed and there is no progress.
The process is going slowly due to time restraints of other volunteers who review and accept the PRs.
Goals of the GUI improvements are better clarifying tags, as well as fixing some bugs I've identified.
Did not understand. Did you mean find hostnames associated to a particular IP?
Not yet, but it's not difficult to find.
Is the ask of this FR just to have one central place that lists all the tags in use? I've thought of adding this, but I question its limited helpfulness: you can see them but you can't do much else with them.
What is this intended to help with? To find where they're used?
As in, can you tell OpenWrt to return specific IP addresses corresponding to certain hostnames in respect of only particular LAN devices? So say to retun for youtube.com 216.239.38.120 only if the requesting LAN device is 192.168.1.200.
Edit: the only conceivable way I can think of right now is to run two instances of dnsmasq, each on a separate IP. Send that separate IP as a special DNS option --dhcp-option to a --dhcp-mac using a unique tag. Associate those host records with a particular dnsmasq instance. But today there is no way to define host records to a dnsmasq instance... the way things are today, is that those domain entries end up in the HOSTFILE for each instance.
Otherwise check --dynamic-host usage. It's not far off.