DHCP Server provider the same IP for two different VMs
-
The VMs have different MAC addresses, but when they start they receive the same IP.
What could be wrong?DHCP Logs
-
@aloisiobilck So, what exactly are you saying...is pfSense involved?
-
@NollipfSense
Yes, I'm using pfsense's DHCP Server. -
@aloisiobilck Well, that's odd...
-
@aloisiobilck Are they both named "ubuntuserver2204" or is that the same VM?
-
Hi,
Both have the origin of a template. But after the VMs are started the hostname are changed. MAC addresses of the VMs are different.
The DHCP Server does not validate hostname. right ? -
@aloisiobilck said in DHCP Server provider the same IP for two different VMs:
Hi,
Both have the origin of a template. But after the VMs are started the hostname are changed. MAC addresses of the VMs are different.
The DHCP Server does not validate hostname. right ?So, that's why it ended up with the same exact hostname for different MACs. I know for sure that it validates host override hostname if pfSense is doing DNS.
-
@NollipfSense
Sorry, but which DNS are you talking about?
Would it be the "Dynamic DNS" parameter in the dhcp server? -
@aloisiobilck Here System > General
-
@aloisiobilck said in DHCP Server provider the same IP for two different VMs:
Both have the origin of a template
I am not 100% on this - but if the client requests its last IP, then that would be offered to it even if the mac is different. I can try and duplicate that..
You need to look in the discover to see if client is asking for its old IP..
For example - here is client asking for the IP it had last time..
-
@johnpoz said in DHCP Server provider the same IP for two different VMs:
if the client requests its last IP, then that would be offered to it even if the mac is different
That was going to be my next question, if the template had been made after the DHCP lease had been obtained. Still, I would hope the DHCP server would not double assign it, and tell the second VM that IP is not available.
In 23.09 they are including Kea DHCP as a preview, since ISC DHCP will be discontinued. Might change the behavior.
Edit: I have run into this with application software, for instance if someone clones a computer after installing antivirus or RMM software, and there are two programs now using the same internal ID.
-
@SteveITS yeah you would hope no dupe should be assigned. So if the 1st device was on.. the ping check dhcpd should be doing before offer should catch it and not offer what the client requested.
And then you also have the client that should be sending out a arp probe for that IP before.. client should send a arp probe and if something answers it should send a decline vs ack..
As a simple test I was going to fire up a vm.. have it get an IP, and then shut it down and change its mac and then boot it and see if it requests the same IP and gets it.. Or could just create another clone of the vm, leaving it online and then fire up the clone with different mac and see if also requests - but this time it shouldn't get it because there is something actually online with the IP.
-
This post is deleted! -
@pwood999 said in DHCP Server provider the same IP for two different VMs:
ARP before the discover as that's broadcast.
where did I say there would be an arp before discover? The dhcp server would do a ping to the IP, this could produce an arp if the IP is not in the arp cache already.
The client upon getting an offer for IP X, would do an arp probe for that IP before it sends its ack, if it gets a response to that arp probe it would send a decline instead so the dhcpd would send another offer with different IP.
I haven't seen a dupe IP issue in years and years and years - other than static duplication, ie PEBKAC.. Both dhcpd and dhclient have safety measures in place to prevent duplication. Not saying that can not happen.. But they should be rare for sure, and some sort of mitigating circumstances have to be at play.. Like disable of the features that try and prevent duplication.
edit:
Example from my previous example of client requesting a specific IP - can see that the client was probing for that IP 192.168.9.100 that it was requestingA probe is different than a normal arp, asking hey this is IP X who has IP Y..
-
@NollipfSense
Sorry for the delay in answering. I changed the DNS, but the problem continues. -
@aloisiobilck And what does dns have to do with anything? What did you change exactly?
-
-
@aloisiobilck yeah that has zero to do with it that is for sure. And I highly doubt you want pfsense to not be able to resolve its own records.. The default is what you would most likely.. I resolve so there is nothing to fall back to.. So I use local only.. But again that has zero to do with anything..
I don't see where he told you to change that.. He said that pfsense validates host overrides..
-
Is there something I did wrong in pfsense for this to happen?
Simply the DHCP Server hands over the same IP to a new VM. -
@aloisiobilck lets go over this again.. If your new VM asks for an IP, it will get it..
Did you sniff to see if the new vm is asking for the same IP?
I specifically showed an example where box was asking for the old IP..
Please do a packet capture of the dhcp and look to see if the client is asking for the same IP.. You could prob clear up the problem by just doing a release and then renew on the client. So it doesn't ask for an old IP.