Virtual Bridge IP "Sticky"

Codeedog

New Member
Feb 26, 2024
1
0
1
San Francisco
[Obligatory new to Proxmox banner...]

Summary:

Despite a different MAC address a Virtual Bridge on a cloned VM gets the same IP assigned through DHCP. Is this a feature of the cloning process and happening at the guest layer or the virtual bridge layer?

Details:

Proxmox: 8.1.4
Guest OS: FreeBSD 13.2-RELEASE
VMs: all three running from a template built from OS. All have a virtual bridge vmbr1.

VM1 has `dnsmasq` handling DHCP and DNS assignments.
VM2 is unremarkable.
VM3 is a clone of VM2.

Steps (reproduce behavior):
  1. Run VM2
  2. VM2(bc:24:11:77:79:63) gets 172.17.0.100 from DHCP server on VM1
  3. Shutdown VM2
  4. Clone VM3 from VM2 w/ MAC address auto changed
  5. VM3 MAC Address is bc:24:11:ab:08:12 (diff than VM2)
  6. Start VM3, acquires 172.17.0.100 from somewhere (I have not debugged the DHCP log)
  7. Check DHCP lease database (/var/db/dnsmasq.leases) and there are two entries for same IP, one per MAC
Steps (work-around behavior, get different IP):
  1. Same as Steps 1-4
  2. Delete network device under hardware; recreate with same vmbr1
  3. Startup VM3
  4. New IP acquired from DHCP: 172.17.0.101
I do not believe dnsmasq running on VM1 is involved in the address selection process. I suspect VM3's virtual bridge vmbr1 retains the fact that it was 172.17.0.100 and sends a request to the DHCP server to use that address (renew vs. request).

In fact, now that I'm writing this (again, without turning on logging and debugging), I suspect that the cloned state of VM2 gets transferred over to VM3 and despite a different MAC address, the interface or the device stack retains the IP address somewhere and makes a DHCP renew with it versus an entirely new IP request. When I delete the virtual bridge (effectively pulling out a NIC and dropping in a new one), that wipes the slate clean and VM3 requests a new DHCP address. In both cases, the MAC address was different than the original VM2 machine's MAC, so the difference must be a preserved clone's hardware state.

Am I correct in my thinking?

Thank you.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!