Help setting up dhcp pool for specific devices

I have specific devices that I want configured with different DNS addresses. All of these devices have reserved IP addresses. I'm not opposed to creating separate IP ranges for each pool, and moving these devices to those IP addresses.

Is this possible with dnsmasq? is there a package for this (I've been looking)?

you can assign separate DNSes per DHCP entry.

6, is dns

https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

Use tags as described here.

Assign custom DNS and possibly other individual DHCP options to the tagged hosts.

uci set dhcp.j400="host"
uci set	dhcp.j400.name="j400"
uci set	dhcp.j400.mac="00:21:63:75:aa:17"
uci set	dhcp.j400.ip="10.11.12.14"
uci set	dhcp.j400.tag="vpn"
uci set dhcp.j500="host"
uci set	dhcp.j500.name="j500"
uci set	dhcp.j500.mac="01:22:64:76:bb:18"
uci set	dhcp.j500.ip="10.11.12.15"
uci set	dhcp.j500.tag="vpn"
uci set dhcp.vpn="tag"
uci set dhcp.vpn.dhcp_option="6,8.8.8.8,8.8.4.4"
uci commit dhcp
/etc/init.d/dnsmasq restart
1 Like

This is on the right track, but I'm not doing this for VPN clients. I could roll my own commands if I could get a better reference for the syntax.

I've used some dnsmasq options before, but manipulating them with uci isn't something I'm used to yet.

This is just an example and so is the name vpn in the tag. Feel free to use whatever name you wish. The important is to match the tag in the host section and the tag section. And of course assign the nameservers you wish in the tag with option 6 as shown in the example.

1 Like

Okay, I think I've got it. I'll try it out later today.