dnsmasq giving out IPs in the static range

5,003

Old post but I'll give this a go....

This is because all ranges have the same subnet ..

If eth0 was 10.1.1.1 then it would provide addresses within 10.1.1.2 to 10.1.1.254 that came in through that interface. This is why all new machines get addresses within that lower (red) range.

But if you had a second physical interface (eth1/wlan0 on 10.1.2.1) then all requests coming in through that; would be given addresses within the 10.1.2.x range, if configured that way. This is the only way I know of; of separating traffic easily with firewall rules etc.

Because all ranges have the same subnet; dnsmasq is just assigning IPs that are within its own listening interfaces network . 10.1.1.x

In man dnsmasq about dhcp-ranges it states If you have more than one network, you will need to repeat this for each network on which you want to supply DHCP service.. This to me; means another physical interface and naming them by colour is how I distinguish networks, by using different coloured cables. :)

Reading more into the dnsmasq documentation, I think /etc/hosts is used as part of the nameserver and not DHCP assignment as static IP's usually require a machine name or MAC address to function correctly.

Share:
5,003

Related videos on Youtube

sinister.groupon
Author by

sinister.groupon

Updated on September 18, 2022

Comments

  • sinister.groupon
    sinister.groupon almost 2 years

    I have the following in my dnsmasq.conf:

    dhcp-range=set:red,10.1.1.2,10.1.1.69,72h,static
    dhcp-range=set:blue,10.1.1.70,10.1.1.100,72h,static
    dhcp-range=set:white,10.1.1.101,10.1.1.200,12h
    dhcp-range=10.1.1.201,10.1.1.250,12h
    

    I would have thought that the first two ranges would be off limits to anyone not in the hosts file, i.e. reserved for static IP reservations.

    However, when I add a random device in the network, it seems to assign an IP in the red range for example, even though there is no static IP reservation for it. I would have expected an IP to be assigned in the 10.1.1.101 to 10.1.1.250 range.

    Does this feature work differently than I expect?