Re: [Dnsmasq-discuss] Dynamic-range clients don't get the same IP address when rebooted

2016-06-24 Thread John Groves (jgroves)
Many thanks Simon!  I automated setting the client-id to the mac address and 
it's doing "the right thing"

Cheers,
John

-Original Message-
From: Dnsmasq-discuss [mailto:dnsmasq-discuss-boun...@thekelleys.org.uk] On 
Behalf Of Simon Kelley
Sent: Thursday, June 23, 2016 4:47 PM
To: dnsmasq-disc...@thekelleys.org.uk
Subject: Re: [Dnsmasq-discuss] Dynamic-range clients don't get the same IP 
address when rebooted

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256



On 23/06/16 21:02, John Groves (jgroves) wrote:
> I'm a long-time dnsmasq user, but first-time poster.  I can't imagine 
> that this hasn't been discussed before, but I wasn't able to come up 
> with search terms to find it.
> 
> This arises because we are creating and destroying VMs like crazy for 
> automated software testing.  The VMs are using dynamic-range 
> addresses, and every time a VM is rebooted it gets a new address, even 
> if there is a valid existing lease.  And we see leases for the same 
> mac address accumulating in the leases file, like this:
> 
> 1466722310 52:54:00:51:e7:ad 10.114.5.186 localhost 
> ff:00:51:e7:ad:00:01:00:01:1e:fe:ec:44:52:54:00:51:e7:ad 1466722212 
> 52:54:00:51:e7:ad 10.114.5.185 * 
> ff:00:51:e7:ad:00:01:00:01:1e:fe:eb:e2:52:54:00:51:e7:ad 1466719093 
> 52:54:00:51:e7:ad 10.114.5.184 * 
> ff:00:51:e7:ad:00:01:00:01:1e:fe:df:b3:52:54:00:51:e7:ad 1466718818 
> 52:54:00:6f:8c:2a 10.114.5.227 * 
> ff:00:6f:8c:2a:00:01:00:01:1e:fe:de:9f:52:54:00:6f:8c:2a 1466715993
> 52:54:00:4a:54:e7 10.114.5.179 *
> ff:00:4a:54:e7:00:01:00:01:1e:fe:d3:96:52:54:00:4a:54:e7
> 
> Is there a way to coax dnsmasq to give out an address matching the 
> still-valid lease, if any?
> 
> FYI the VMs are mostly Fedora 2[234] and RHEL7
> 
> The changing addresses are a challenge for our test automation...
> 
> Thanks, John Groves

If the DHCP provides a client-id, that's used to identify the client in 
preference to the MAC address. The client-id is the last field on each line of 
the lease-file, and we can see the client-ids for each lease associated with a 
single MAC address are different in a couple of bytes. These bytes are probably 
generated from the system time.

To fix this, build your VMs to not provide a client-id, or one completely 
determined by the MAC address. You can also configure dnsmasq to ignore the 
client-id with something like


dhcp-host=52:54:00:*:*:*,id:*

Cheers,

Simon.



-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCAAGBQJXbFjfAAoJEBXN2mrhkTWiej4P/20kUt94wBuhowgrxg0VOBrP
PV2uj9XTdpNG5Ys9Mb7pgFzxlwx7Hus2d8g0JnaPjo0CPK4eUDe8qhKKZi7ppL7k
kL9ZFmMVBVD63x5NRPcGpPMQytQJt0Fi89lrvTXf+y+TOv/MsmEbOjSh5euIA9N7
rCNDGVuykgSj6MBKO4kEd0T6w/hrouEIJEFnXIpo5Bbav9FM4+IB+CPbfvrG16vq
zgf1R4Oh3UoCS4QTHlbV1C7xVAAw2jckRK+Rc/F5aN+i+HpSiheS3t8kk24gOB+m
xrar1Bt8lzbeY1RCZRgQkX9UJrhN13zpfuVQ4OHSqomj1Mtgs6G9Saa0vYmd0hI7
A/Gg2mKf1FeUq7uudJ/V4znS/nTRfVZaPZRSMb+M0Q/rzPFUx6+nzBDRBwDqFB01
zXg7Zj8a1f0JQ2BL0VIA994OLDznZYieCVMxWBBMSKgpwsgAyolY5Zak6c8izhkF
dGG9JTv7C2FMr/L3Pl4IifntfURxgTH3XkhRKgSZsJza5MO45GbOeJNy4t+b4A09
xzv1EjPj+hyI1QmzTqGBdPvywV4jb+v2Lmfg+nHL0W0LwMv7q5yCFCsNq9k0CMW9
HxZsx1P5KVWm91DMO1bk2DfouWNUr1v3GIux/5gPaZxUGu7Ve03L28ZIMIh+ZPJ4
1WD8PzsiJSyLnakOiLX6
=GFIb
-END PGP SIGNATURE-

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Cannot obtain IP address from dnsmasq

2016-06-24 Thread Albert ARIBAUD
Hi Matwey,

Le Fri, 24 Jun 2016 19:30:04 +0300
"Matwey V. Kornilov"  a écrit:

> 2016-06-24 19:19 GMT+03:00 Albert ARIBAUD :
> > Hi Matwey,
> >
> > Le Fri, 24 Jun 2016 12:10:53 +0300
> > "Matwey V. Kornilov"  a écrit:
> >  
> >> Hello,
> >>
> >> I am running dnsmasq-2.71 and experiencing the following issue.
> >>
> >> I have network interface eth3 with 10.3.0.1/24 address assigned to
> >> it. I want dnsmasq instance to supply everyone on eth3 L2-segment
> >> with IP address from 10.3.0.1/24 subnet. I don't want DHCP be
> >> running on other interfaces where it can interfere others.
> >>
> >> The issue is the following, HP commutator can not obtain address.
> >>
> >> 12:03:01.609174 IP 192.168.1.1.68 > 255.255.255.255.67: BOOTP/DHCP,
> >> Request from 40:a8:f0:6f:64:40, length 256
> >> 12:03:23.952477 IP 192.168.1.1.68 > 255.255.255.255.67: BOOTP/DHCP,
> >> Request from 40:a8:f0:6f:64:40, length 256
> >>
> >> At the same time, other devises obtain address successfully:
> >>
> >> 12:03:45.311101 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
> >> Request from 44:aa:e8:00:0c:4e, length 249
> >> 12:03:45.313634 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP,
> >> Reply, length 300
> >> 12:03:45.340273 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
> >> Request from 44:aa:e8:00:0c:4e, length 256
> >> 12:03:45.371271 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP,
> >> Reply, length 300
> >> 12:03:45.395392 IP 10.3.0.33.1025 > 239.255.255.250.1900: UDP,
> >> length 320 12:03:46.884261 IP 0.0.0.0.68 > 255.255.255.255.67:
> >> BOOTP/DHCP, Request from 44:aa:e8:00:0c:46, length 249
> >> 12:03:46.885707 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP,
> >> Reply, length 300
> >> 12:03:46.911271 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
> >> Request from 44:aa:e8:00:0c:46, length 256
> >> 12:03:46.945596 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP,
> >> Reply, length 300
> >> 12:03:46.968662 IP 10.3.0.32.1025 > 239.255.255.250.1900: UDP,
> >> length 320 12:03:50.390213 IP 10.3.0.33.1025 >
> >> 239.255.255.250.1900: UDP, length 320
> >>
> >> I suppose, that the issue here is that HP's source address is
> >> 192.168.1.1, how could I configure dnsmasq to overcome this
> >> issue?  
> >
> > The above is a tcpdump log. What does dnsmaq itself log? Think of
> > adding the log-dhcp option to the dnsmasq config file beforehand.
> >  
> 
> Nothing about 192.168.1.1 in log-dhcp, unfortunately.

Not a dnsmasq issue, then: if the request from 192.168.1.1 never
reaches dnsmasq, it's either dnsmasq not listening on the right
interface or a network issue. Since requests from others on the
same physical network segment are seen, dnsmasq is listening on the
right interface. Therefore, it is a network issue.

Amicalement,
-- 
Albert.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Cannot obtain IP address from dnsmasq

2016-06-24 Thread Dan Sneddon
On 06/24/2016 02:10 AM, Matwey V. Kornilov wrote:
> Hello,
> 
> I am running dnsmasq-2.71 and experiencing the following issue.
> 
> I have network interface eth3 with 10.3.0.1/24 address assigned to it.
> I want dnsmasq instance to supply everyone on eth3 L2-segment with IP
> address from 10.3.0.1/24 subnet. I don't want DHCP be running on other
> interfaces where it can interfere others.
> 
> The issue is the following, HP commutator can not obtain address.
> 
> 12:03:01.609174 IP 192.168.1.1.68 > 255.255.255.255.67: BOOTP/DHCP,
> Request from 40:a8:f0:6f:64:40, length 256
> 12:03:23.952477 IP 192.168.1.1.68 > 255.255.255.255.67: BOOTP/DHCP,
> Request from 40:a8:f0:6f:64:40, length 256
> 
> At the same time, other devises obtain address successfully:
> 
> 12:03:45.311101 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request
> from 44:aa:e8:00:0c:4e, length 249
> 12:03:45.313634 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply,
> length 300
> 12:03:45.340273 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request
> from 44:aa:e8:00:0c:4e, length 256
> 12:03:45.371271 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply,
> length 300
> 12:03:45.395392 IP 10.3.0.33.1025 > 239.255.255.250.1900: UDP, length 320
> 12:03:46.884261 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request
> from 44:aa:e8:00:0c:46, length 249
> 12:03:46.885707 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply,
> length 300
> 12:03:46.911271 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request
> from 44:aa:e8:00:0c:46, length 256
> 12:03:46.945596 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply,
> length 300
> 12:03:46.968662 IP 10.3.0.32.1025 > 239.255.255.250.1900: UDP, length 320
> 12:03:50.390213 IP 10.3.0.33.1025 > 239.255.255.250.1900: UDP, length 320
> 
> I suppose, that the issue here is that HP's source address is
> 192.168.1.1, how could I configure dnsmasq to overcome this issue?
> 
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

I'm going to take a wild guess at your problem, based on the limited
data available.

If the DHCP request is coming from 192.168.1.1, that sounds like a
configuration issue on the HP commutator (whatever that is). Is the HP
configured to use a particular IP with DHCP (for the subnet mask,
gateway, etc.)? If so, you need to reconfigure the HP, because it won't
be able to obtain a reservation for it's preferred IP because it's on
the wrong subnet. You can either configure the HP to use a static IP on
the correct subnet, or modify it to obtain an IP address dynamically.

-- 
Dan Sneddon |  Principal OpenStack Engineer
dsned...@redhat.com |  redhat.com/openstack
650.254.4025|  dsneddon:irc   @dxs:twitter

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Cannot obtain IP address from dnsmasq

2016-06-24 Thread Matwey V. Kornilov
2016-06-24 19:19 GMT+03:00 Albert ARIBAUD :
> Hi Matwey,
>
> Le Fri, 24 Jun 2016 12:10:53 +0300
> "Matwey V. Kornilov"  a écrit:
>
>> Hello,
>>
>> I am running dnsmasq-2.71 and experiencing the following issue.
>>
>> I have network interface eth3 with 10.3.0.1/24 address assigned to
>> it. I want dnsmasq instance to supply everyone on eth3 L2-segment
>> with IP address from 10.3.0.1/24 subnet. I don't want DHCP be running
>> on other interfaces where it can interfere others.
>>
>> The issue is the following, HP commutator can not obtain address.
>>
>> 12:03:01.609174 IP 192.168.1.1.68 > 255.255.255.255.67: BOOTP/DHCP,
>> Request from 40:a8:f0:6f:64:40, length 256
>> 12:03:23.952477 IP 192.168.1.1.68 > 255.255.255.255.67: BOOTP/DHCP,
>> Request from 40:a8:f0:6f:64:40, length 256
>>
>> At the same time, other devises obtain address successfully:
>>
>> 12:03:45.311101 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
>> Request from 44:aa:e8:00:0c:4e, length 249
>> 12:03:45.313634 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP,
>> Reply, length 300
>> 12:03:45.340273 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
>> Request from 44:aa:e8:00:0c:4e, length 256
>> 12:03:45.371271 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP,
>> Reply, length 300
>> 12:03:45.395392 IP 10.3.0.33.1025 > 239.255.255.250.1900: UDP, length
>> 320 12:03:46.884261 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
>> Request from 44:aa:e8:00:0c:46, length 249
>> 12:03:46.885707 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP,
>> Reply, length 300
>> 12:03:46.911271 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
>> Request from 44:aa:e8:00:0c:46, length 256
>> 12:03:46.945596 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP,
>> Reply, length 300
>> 12:03:46.968662 IP 10.3.0.32.1025 > 239.255.255.250.1900: UDP, length
>> 320 12:03:50.390213 IP 10.3.0.33.1025 > 239.255.255.250.1900: UDP,
>> length 320
>>
>> I suppose, that the issue here is that HP's source address is
>> 192.168.1.1, how could I configure dnsmasq to overcome this issue?
>
> The above is a tcpdump log. What does dnsmaq itself log? Think of
> adding the log-dhcp option to the dnsmasq config file beforehand.
>

Nothing about 192.168.1.1 in log-dhcp, unfortunately.

> Amicalement,
> --
> Albert.



-- 
With best regards,
Matwey V. Kornilov
http://blog.matwey.name
xmpp://0x2...@jabber.ru

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Is there a way to make dnsmasq.leases show FQDN?

2016-06-24 Thread John Petrucci
I am using different domains for different subnets, and this works
properly.  I can see that the client's lease shows the correct domain.  I
also see that dnsmasq.leases shows multiple entries now for clients with
the same name but different subnets.  The problem is that the name in
dnsmasq.leases is unqualified, so unless a viewer knows the association
between subnet and domain, there is no way to tell which lease is for which
domain.
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Cannot obtain IP address from dnsmasq

2016-06-24 Thread Albert ARIBAUD
Hi Matwey,

Le Fri, 24 Jun 2016 12:10:53 +0300
"Matwey V. Kornilov"  a écrit:

> Hello,
> 
> I am running dnsmasq-2.71 and experiencing the following issue.
> 
> I have network interface eth3 with 10.3.0.1/24 address assigned to
> it. I want dnsmasq instance to supply everyone on eth3 L2-segment
> with IP address from 10.3.0.1/24 subnet. I don't want DHCP be running
> on other interfaces where it can interfere others.
> 
> The issue is the following, HP commutator can not obtain address.
> 
> 12:03:01.609174 IP 192.168.1.1.68 > 255.255.255.255.67: BOOTP/DHCP, 
> Request from 40:a8:f0:6f:64:40, length 256
> 12:03:23.952477 IP 192.168.1.1.68 > 255.255.255.255.67: BOOTP/DHCP, 
> Request from 40:a8:f0:6f:64:40, length 256
> 
> At the same time, other devises obtain address successfully:
> 
> 12:03:45.311101 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
> Request from 44:aa:e8:00:0c:4e, length 249
> 12:03:45.313634 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP,
> Reply, length 300
> 12:03:45.340273 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
> Request from 44:aa:e8:00:0c:4e, length 256
> 12:03:45.371271 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP,
> Reply, length 300
> 12:03:45.395392 IP 10.3.0.33.1025 > 239.255.255.250.1900: UDP, length
> 320 12:03:46.884261 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
> Request from 44:aa:e8:00:0c:46, length 249
> 12:03:46.885707 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP,
> Reply, length 300
> 12:03:46.911271 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
> Request from 44:aa:e8:00:0c:46, length 256
> 12:03:46.945596 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP,
> Reply, length 300
> 12:03:46.968662 IP 10.3.0.32.1025 > 239.255.255.250.1900: UDP, length
> 320 12:03:50.390213 IP 10.3.0.33.1025 > 239.255.255.250.1900: UDP,
> length 320
> 
> I suppose, that the issue here is that HP's source address is 
> 192.168.1.1, how could I configure dnsmasq to overcome this issue?

The above is a tcpdump log. What does dnsmaq itself log? Think of
adding the log-dhcp option to the dnsmasq config file beforehand.

Amicalement,
-- 
Albert.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Win10 Dhcpv6 issue?

2016-06-24 Thread Xander Victory
I'm having some trouble getting windows 10 to keep its v6 lease, it seem 
to fail to renew.


From packet sniffing it seems to just be ignoring DNSMasq's replies to 
the renew packets, and then falls back to soliciting continuously, 
despite being replied to.


I've attached the pcap files (hopefully). Shows that it acquires it on 
reboot, but fails after the lease time is (about to?) expire - set at 2 
hours because of issues with the xbox one getting a new address each 
boot (you can see in the 2nd pcap that it renews its address just fine).


Is windows 10 borked or is it something with my config? I'm unsure if 
this is a recent development or not to be honest.


Not exactly related, but I've noticed that DNSMasq sends its v6 packets 
(router advertisements and dhcpv6) from the full link local address, 
even though the default address is a manually configured fe80::1


relevant config:

dhcp-host=id:00:01:00:01:1a:1b:af:8c:bc:5f:f4:d8:41:bc,[::3],bc:5f:f4:d8:41:bc,10.1.2.6,xander
dhcp-range=br0,10.1.2.100,10.1.2.249,255.255.255.0,12h
dhcp-range=br0,2001:44b8:610e:3c00::4,2001:44b8:610e:3c00::,2h
enable-ra


win10-dhcp-initial.pcap
Description: Binary data


win10-dhcp-subsequent-2.pcap
Description: Binary data
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Cannot obtain IP address from dnsmasq

2016-06-24 Thread Matwey V. Kornilov

Hello,

I am running dnsmasq-2.71 and experiencing the following issue.

I have network interface eth3 with 10.3.0.1/24 address assigned to it. I 
want dnsmasq instance to supply everyone on eth3 L2-segment with IP 
address from 10.3.0.1/24 subnet. I don't want DHCP be running on other 
interfaces where it can interfere others.


The issue is the following, HP commutator can not obtain address.

12:03:01.609174 IP 192.168.1.1.68 > 255.255.255.255.67: BOOTP/DHCP, 
Request from 40:a8:f0:6f:64:40, length 256
12:03:23.952477 IP 192.168.1.1.68 > 255.255.255.255.67: BOOTP/DHCP, 
Request from 40:a8:f0:6f:64:40, length 256


At the same time, other devises obtain address successfully:

12:03:45.311101 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request 
from 44:aa:e8:00:0c:4e, length 249
12:03:45.313634 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, 
length 300
12:03:45.340273 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request 
from 44:aa:e8:00:0c:4e, length 256
12:03:45.371271 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, 
length 300

12:03:45.395392 IP 10.3.0.33.1025 > 239.255.255.250.1900: UDP, length 320
12:03:46.884261 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request 
from 44:aa:e8:00:0c:46, length 249
12:03:46.885707 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, 
length 300
12:03:46.911271 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request 
from 44:aa:e8:00:0c:46, length 256
12:03:46.945596 IP 10.3.0.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, 
length 300

12:03:46.968662 IP 10.3.0.32.1025 > 239.255.255.250.1900: UDP, length 320
12:03:50.390213 IP 10.3.0.33.1025 > 239.255.255.250.1900: UDP, length 320

I suppose, that the issue here is that HP's source address is 
192.168.1.1, how could I configure dnsmasq to overcome this issue?



___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss