Multiple subnets with dnsmasq

6,198

I believe this link answers your question:

http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2010q3/004415.html

Specifically:

At first glance, what you're doing doesn't make any sense. You have two subnets on one interface, which is fine, but the only thing that defines which subnet a machine is on is its IP address, and DHCP allocates that address. Before the address is allocated, all that's known about a machine is that it's on a particular physical network, there's no way to pin it down to a subnet.

Share:
6,198

Related videos on Youtube

user5740843
Author by

user5740843

Updated on September 18, 2022

Comments

  • user5740843
    user5740843 almost 2 years

    I've done some research on dnsmasq and its ability to DHCP several subnets, but it sadly only seems to work when there are multiple interfaces as shown in the configuration below:

    interface=eth0
    interface=eth1
    interface=eth2
    dhcp-range=192.168.0.100,192.168.0.200
    dhcp-range=192.168.1.100,192.168.1.200
    dhcp-range=192.168.2.100,192.168.2.200
    

    However, I have not been able to see the possibility to have one interface, let's say eth0 to service multiple subnets, something along these lines:

    interface=eth0
    dhcp-range=192.168.0.100,192.168.2.200
    

    Is this possible? If not by dnsmasq config, is there a work-around?

    Thanks!

    • Tero Kilkanen
      Tero Kilkanen about 7 years
      You should not have two IP subnets in the same broadcast domain (Ethernet interface). It will break some things.