Score:0

configure dnsmasq to give out addresses in different ranges

bz flag

I'd like to give unknown clients an ip address in one range and known clients in another (that is a static one).

I tried quite a lot now and don't seem to get it working. All I get is an "no address available" error.

My network is 10.1.0.0/22 (<-!!!) Guests should be assigned an address in the range 10.1.3.1-10.1.3.254 Static addresses are in range 10.1.2.1-10.1.2.254

so this is my config:

iface eth0 inet static
    address 10.1.0.2/22
    gateway 10.1.0.1

eth0@if17: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 10.1.0.2/22 brd 10.1.3.255 scope global eth0
        valid_lft forever preferred_lft forever

and

dhcp-range=tag:guests,10.1.3.1,10.1.3.254,255.255.252.0,12h
dhcp-range=tag:known,10.1.2.0,static,24h
dhcp-option=option:router,10.1.0.1
dhcp-option=option:dns-server,10.1.0.3
dhcp-option=option:ntp-server,10.1.0.1

dhcp-host=aa:bb:cc:dd:ee:ff,10.1.2.1
dhcp-host=11:22:33:44:55:66,10.1.3.2

Known hosts are given their addresses (regardless if its a .2. or .3. address) but unknown dont get anything.

Score:0
bz flag

Seems the problematic part was: tag:known. For some reason dnsmasq doesn't show something different in startup log messages when I remove it but now seems to work. (I cant tell if it works with /22 because I stoped using it.)

Score:0
cn flag

You're not giving a netmask for the tag:known range, so dnsmasq will assume it's the entire /22, completely covering the tag:guests range.

Scheintod avatar
bz flag
Thanks for your answer. How would I do that? All my tries like: ```dhcp-range=tag:known,10.1.2.0,255.255.255.0,static,24h``` or ```dhcp-range=tag:known,10.1.2.1,10.1.2.254,255.255.255.0,static,24h``` result in dnsmasq not even starting. (bad dhcp-range at line 2 of /etc/dnsmasq.d/dhcp)
cn flag
try `dhcp-range=tag:known,10.1.2.1,static,255.255.255.0,24h` (this is just a hunch, unfortunately I'm not able to test it right now ;-))
Scheintod avatar
bz flag
that does start but result (even in different 252/255 combinations) all in no address available :(
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.