[Dnsmasq-discuss] Dnsmasq dns/dhcp with multiple subnet - lease file issue

Robert Tsai rtsai.mobile at gmail.com
Mon Sep 9 19:21:15 BST 2013


I understand. If the storage subnet clients get a DHCP lease, but the
leases never appear in dnsmasq.leases file, then they may well be getting a
DHCP lease from another DHCP server on that network. You really need to
check the logs to see if the clients are talking to dnsmasq, or another
DHCP server that's there accidentally.


Ah great!   We are using VMWare VCloud and on our isolate network they had
dhcp turned on.  I can the request from the client in dnsmasq.log but their
dhcp server was the one assigning the IP.  Sorry for overlook on that.  Its
now working properly.

However, I do have domain= set with the following:

domain=app.domain.net,10.10.123.201,10.10.123.240
domain=str.domain.net,10.10.133.201,10.10.133.240


and I did have the domain set after the range as well

dhcp-range=app,10.10.123.201,10.10.123.240,12h,app.domain.net
dhcp-range=storage,10.10.133.201,10.10.133.240,12h,str.domain.net

-Robert






On Mon, Sep 9, 2013 at 6:12 AM, Simon Kelley <simon at thekelleys.org.uk>wrote:

> On 09/09/13 14:07, Robert Tsai wrote:
>
>> Hi Simon,
>>
>> Thanks for the reply!  Sorry I didn't clarify,  each subnet is on its
>> own nic on  the dnsmasq server.   The storage subnet is an isolate
>> non-routed network.  So the storage subnet clients do get a ip from
>> dhcp but the mac, lease, and hostname never get populated to the
>> dnsmasq.leases file only the app subnet clients do.  Btw, my current
>> dnsmasq server is on ver 2.48 on centos6.3.
>>
>
> I understand. If the storage subnet clients get a DHCP lease, but the
> leases never appear in dnsmasq.leases file, then they may well be getting a
> DHCP lease from another DHCP server on that network. You really need to
> check the logs to see if the clients are talking to dnsmasq, or another
> DHCP server that's there accidentally.
>
>
>> As for dhclient sending host name, is it possible to have, for
>> example, a subdomin added to the hostname?  I tried to send node.str
>> but dnmasq ignores anything after node\.  Again really appreciate the
>> help!
>>
>
>
> Check the --domain dnsmasq config option - you can associate domains with
> subnets.
>
>
> Cheers,
>
> Simon.
>
>
>
>> Robert
>>
>>
>>
>> Sent from my iPhone
>>
>> On Sep 9, 2013, at 3:33 AM, Simon Kelley<simon at thekelleys.org.uk**>
>> wrote:
>>
>>  On 08/09/13 14:09, Robert Tsai wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> I am having issues with dnsmasq with dns/dhcp with multple
>>>> subnets. I have two subnets , one named app and the other
>>>> storage.  Both subnet clients get ips through dhcp but only the
>>>> app subnet client's lease gets propagated to
>>>> /var/lib/dnsmasq.leases.  The storage subnet client's lease never
>>>> gets written to that file.
>>>>
>>>
>>> I'm assuming that both subnets are on the same physical network
>>> adapator.
>>>
>>> A client (as identified by MAC address) can't have two leases at
>>> once. My guess is that the first lease achieved is on the storage
>>> subnet, and that gets deleted when the same client gets another
>>> lease. It's worth looking in the system log to see what happening,
>>> and also worth setting --log-dhcp to get more information there.
>>>
>>> One way around this is to configure the DHCP clients to send
>>> different client-IDs for the two subnets, they'll be treated as two
>>> different leases for two different clients.
>>>
>>> Also if I have a
>>>
>>>> client server that needs to have both subnets and sends its
>>>> host-name from dhclient, will dnsmasq add both host-name to the
>>>> lease file? Any help on this would be appreciated.  Below are the
>>>> options that are set for dhcp and dns.
>>>>
>>>
>>> No. A hostname is only ever associated with one DHCP lease.
>>>
>>>
>>> Cheers,
>>>
>>> Simon.
>>>
>>>  Thanks, Robert
>>>>
>>>> addn-hosts=/etc/dnsmasq.d/**dhcp_qa_hosts bogus-priv
>>>> domain=app.domain.net,10.10.**123.201,10.10.123.240
>>>> domain=str.domain.net,10.10.**133.201,10.10.133.240 domain-needed
>>>> expand-hosts log-dhcp
>>>>
>>>> log-queries dhcp-option=option:dns-server,**10.10.123.5
>>>> dhcp-range=app,10.10.123.201,**10.10.123.240,12h,app.domain.**net<http://app.domain.net>
>>>> dhcp-option=net:app,121,10.10.**120.0/24,10.10.123.241,10.10.**
>>>> 121.0/24,10.10.123.241<http://10.10.120.0/24,10.10.123.241,10.10.121.0/24,10.10.123.241>
>>>>
>>>
>>>
>>>>  dhcp-range=storage,10.10.133.**201,10.10.133.240,12h,str.**domain.net<http://str.domain.net>
>
>>  dhcp-option=net:storage,3
>>>> dhcp-option=net:storage,121,10**.10.130.0/24,10.10.133.241<http://10.10.130.0/24,10.10.133.241>
>>>> dhcp-option=net:app,option:**router,10.10.123.
>>>>
>>>>
>>>>
>>>> ______________________________**_________________ Dnsmasq-discuss
>>>> mailing list Dnsmasq-discuss at lists.**thekelleys.org.uk<Dnsmasq-discuss at lists.thekelleys.org.uk>
>>>> http://lists.thekelleys.org.**uk/mailman/listinfo/dnsmasq-**discuss<http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss>
>>>>
>>>
>>>
>>> ______________________________**_________________ Dnsmasq-discuss
>>> mailing list Dnsmasq-discuss at lists.**thekelleys.org.uk<Dnsmasq-discuss at lists.thekelleys.org.uk>
>>> http://lists.thekelleys.org.**uk/mailman/listinfo/dnsmasq-**discuss<http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss>
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20130909/8f3032e2/attachment.html>


More information about the Dnsmasq-discuss mailing list