all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Philippos Giavridis via pve-devel <pve-devel@lists.proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Philippos Giavridis <philippos.g@me.com>
Subject: [pve-devel] [PATCH pve-network 0/1] Fix duplicate DHCP leases for cloned VMs with same MAC
Date: Tue,  4 Nov 2025 12:20:25 +0000	[thread overview]
Message-ID: <mailman.600.1762272148.362.pve-devel@lists.proxmox.com> (raw)

[-- Attachment #1: Type: message/rfc822, Size: 6411 bytes --]

From: Philippos Giavridis <philippos.g@me.com>
To: pve-devel@lists.proxmox.com
Cc: Philippos Giavridis <philippos.g@me.com>
Subject: [PATCH pve-network 0/1] Fix duplicate DHCP leases for cloned VMs with same MAC
Date: Tue,  4 Nov 2025 12:20:25 +0000
Message-ID: <20251104122026.62228-1-philippos.g@me.com>

This patch fixes an issue where cloned VMs with identical MAC addresses
receive different IP addresses instead of their reserved static DHCP leases.

The current behaviour allows duplicate MAC addresses in the IPAM database,
which leads to unexpected IP assignments. When a VM template with a static
DHCP reservation is cloned and the clone keeps the same MAC address (or
I assign it a NIC with the same MAC), it receives a new dynamic IP rather 
than the existing reservation.

This patch adds a check for existing MAC-to-IP mappings before allocating 
new addresses, so that VMs with already-registered MAC addresses in IPAM
receive their previously assigned IPs.

The issue was discovered and discussed in the Proxmox forum:
https://forum.proxmox.com/threads/ipam-reserving-dhcp-leases-via-mac-addresses.174704/

I have tested this on PVE 8.4 and 9.0.

Philippos Giavridis (1):
  fix: prevent duplicate DHCP leases for identical MAC address

 src/PVE/Network/SDN/Subnets.pm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

-- 
2.43.0



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

                 reply	other threads:[~2025-11-04 16:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.600.1762272148.362.pve-devel@lists.proxmox.com \
    --to=pve-devel@lists.proxmox.com \
    --cc=philippos.g@me.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal