Re: [Dnsmasq-discuss] DHCP, how to ignore the client MAC address?

2019-01-11 Thread Michael Schleicher
Hi Geert,

thanks for you mail.

On 1/11/19 6:50 PM, Geert Stappers wrote:
> On Fri, Jan 11, 2019 at 11:29:13AM +0100, MIchael Schleicher (smicha) wrote:
>> On 11.01.19 10:53, john doe wrote:
>>> On 1/11/2019 9:49 AM, MIchael Schleicher (smicha) wrote:
>>>>
>>>> I have just checked on my environment what's in the dnsmasq.leases file:
>>>>
>>>> 1547246444 00:50:56:85:23:ea 10.198.10.223 win-vm 01:00:50:56:85:23:ea
>>>> 1547276503 00:50:56:85:f1:86 10.198.10.37 linux-vm 01:00:50:56:85:f1:86
>>>>
>>>> As you see the Client-ID (5th field) is the MAC + "01:" as prefix.
>>>>
>>>
>>> You previously said that the hostname is always the same, as ilustrated
>>> by the above they are not (win-vm vs linux-vm)?
>>>
>>
>> That are 2 different systems. (1 Windows and 1 Linux VM). It's just a
>> example
>>
> 
> Thing I would like to known is the name of the virtualisation platform.
> Mostly because all those I seen did allow me to define MAC address.
> 

The virtual landscapes (VM's) are running on VMware ESX Cluster.
The ESX Hosts are "controlled" by a software which called
"eCloud-Manager". That are deploying the different clones of landscapes.

We have a bunch of master VM's and the software deploy that VM's in
different isolated landscapes. (each landscape is isolated with vlans
and includes a copy of the Masters (but with different MAC as the Master
VM's have!).

So, when a cloned VM in one of the virtual landscapes are crash or have
some other problems, the software destorys the VM and deploy a copy of
the Master-VM, with a different MAC to that landscapes.

And that is exactly the problem, during the deployment of that cloned VM
from the Master, the MAC will changed from the eCloud-Manager during the
VMWare deployment.

I hope I gave you a understandable description.

Many Thanks
Michael


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


Re: [Dnsmasq-discuss] DHCP, how to ignore the client MAC address?

2019-01-11 Thread MIchael Schleicher (smicha)

Hi,

thanks for your reply.

On 10.01.19 22:25, wkitt...@gmail.com wrote:

On 1/10/19 3:26 PM, Michael Schleicher wrote:

As I said, for Linux VM's, I can set a uniq Client-ID that helps, but on
Windows you can not set define a Client-ID (as far as I know).


isn't this the machine name? when i was supporting winwhatever, the 
install generated a machine name... that is the name i saw used in DHCP 
requests... it is the name that was added to the DNS so queries on it 
would return its current IP...





I have just checked on my environment what's in the dnsmasq.leases file:

1547246444 00:50:56:85:23:ea 10.198.10.223 win-vm 01:00:50:56:85:23:ea
1547276503 00:50:56:85:f1:86 10.198.10.37 linux-vm 01:00:50:56:85:f1:86

As you see the Client-ID (5th field) is the MAC + "01:" as prefix.

Many Thanks
Michael


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


Re: [Dnsmasq-discuss] DHCP, how to ignore the client MAC address?

2019-01-09 Thread MIchael Schleicher


On 09.01.19 08:14, john doe wrote:

On 1/8/2019 11:31 AM, smicha wrote:

Hi John,

thanks for your reply.

I did some tests with your hints.

On 7.1.2019 17:41, john doe wrote:


Some hints from dnsmasq.conf:

# Give the machine which says its name is "bert" IP address
# 192.168.0.70 and an infinite lease
#dhcp-host=bert,192.168.0.70,infinite


Do not work with my setup, because when we re-deploy a VM, the MAC
address will be autom. changed.
The re-delpoyed VM will than get a different IP as the old vm had before.



I just tested this option  and the behavior described is correct with
dnsmasq 2.76, from the man page:


I have running the version 2.78.


"--dhcp-host=lap,192.168.0.199 tells dnsmasq to always allocate the
machine lap the IP address 192.168.0.199.
Addresses allocated like this are not constrained to be in the range
given by the --dhcp-range option, but they must be in the same subnet as
some valid dhcp-range. For subnets which don't need"


Yes, the config "--dhcp-host=lap,192.168.0.199" is working. The VM with 
the hostname "lap" will get the IP 192.168.0.199.


But, I have the problem, when I have a new VM, a new version of the VM 
"lap" which have a different MAC address.
Than, that new version of VM "lap" get not the 192.168.0.199. They get 
an other IP from the pool.



As long as a client use the hostname ("lap") the same IP will always be
given to that client, the MAC address is not used.



As far as I see, for the "first" IP provisioning that is true -> the 
Hostname is enough.
But, than the "dnsmasq.leases" file have also the MAC address and 
Client-ID values stored, which will be compared an the next DHCP Requests.
If than one of the values are different (MAC, CLIENT-ID) the DHCP-Client 
will get an other IP.


Please see below, a example...




See also (1) for more info on 'dhcp-host'.


1)  http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html



Maybe is it possible to "patch" the code of dnsmasq, where dnsmasq can
ignore the MAC address in the DHCP task?



Possibly, more nolageable dnsmasqer would need to chime in to do that
though! :)
If '--dhcp-host=hostname,IP' is not working for you more info would need
to be provided.




BTW: the VM "lap" does not have set a special "DHCP-Client-Identifier", 
so it use for DHCP-Client-ID the MAC address.



Here some outputs of the dnsmasq.leases file:

# inital DHCP-Request:

1547107342 00:50:56:85:02:fa 192.168.0.199 lap 01:00:50:56:85:02:fa

As you can see, the VM "lap" (MAC 00:50:56:85:02:fa) get the expected IP 
-> so far so good.



Next, I power off the VM "lap" without a DHCP-Release and deploy a copy 
of the VM "lap" which have than an other MAC (00:50:56:85:02:ff) ! -> 
the MAC will always set by the deployment of a new VM version.



Now, I start the new version of the VM "lap" (the old version of the VM 
"lap" is no longer available.


The dnsmasq.leases looks now, like this:
1547116110 00:50:56:85:02:ff 192.168.0.200 lap 01:00:50:56:85:02:ff
1547107342 00:50:56:85:02:fa 192.168.0.199 * 01:00:50:56:85:02:fa


As you see, the VM "lap" have now the IP "192.168.0.200" and not the 
expected IP "192.168.0.199.


Do you have an idea how I can fix that?
I tested different options with "--dhcp-host", but with no luck.

I hope you can help my.

May do you have an hint in which part of the code, I can fake the 
incoming/received "DHCP CLIENT-ID". I think that is one of the key's to 
fix the problem.


As I said before in a prev. mail. The problem is not there, when the 
DHCP-Client sending a uniq DHCP-Client-ID. In Linux that is not the 
problem i can set that, but in Windows I do not have the option to set 
the DHCP-Client-ID ! :-(


Many thanks
Michael






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