Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


DHCP leases after deleting VM
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

DHCP leases after deleting VM

v3ngv3ng Member, Patron Provider

Hi,

I recently configured radvd and DHCP on my Proxmox server to simplify IP management and further automate provisioning.

At first sight this works fine, but I encountered the following problem.

I have several single IPv4's and an IPv6 subnet, which are also allocated to the clients without any problems.

Now the situation is that I often create VMs, run them shortly and then delete them again.
Each time a lease is requested, which is still active afterwards, even if the actual VM was already deleted long ago.

The DHCP server indicates that I have no more IPs until I delete the leases manually.

Is there a better way to do this?

Greetings
v3ng

Comments

  • Maybe set the IP leasing time to something smaller?

  • v3ngv3ng Member, Patron Provider

    Wouldn't that bring some problems with it, If I, for instance, stop an important VM for some time, the IP would then get reassigned, right?

  • sanvitsanvit Member
    edited April 2019

    @v3ng said:
    Wouldn't that bring some problems with it, If I, for instance, stop an important VM for some time, the IP would then get reassigned, right?

    AFAIK you can also use static IPs for the 'important VM'

    e.g. set the DHCP range to 192.168.0.2-100 and assign the important VM in IP range of 192.168.0.101-254.

    Edit 2 : or can't you just increase the IP range to something bigger than a /24 or am I missing something?

  • v3ngv3ng Member, Patron Provider

    I'm asigning my public IPs, so no internal range

    Thanked by 1sanvit
  • v3ngv3ng Member, Patron Provider

    Is it also possible, to set in general, that VMs never get a new IP as long as the MAC doesn’t change?

  • roastroast Member

    No other way you got to do it on your own it requires some effort but when the thing comes out and the relief that thing is so nice I really like the end moment the vibe of it oh wow

  • NeoonNeoon Community Contributor, Veteran

    Static works fine, you likely get into issues, if you deploy a new VM with a random generated mac. Which add's up to new IP's every time.

    So you either set the same mac or use static.
    You can easy, send a Proxmox API request, to clone a existing image, that is configured for DHCP, edit the network adapter, change the mac to that what you want.

Sign In or Register to comment.