Set a dynamic address to PVE

lokomass

New Member
Dec 21, 2022
18
0
1
Hi all,
I'm trying to change static IP of my PVE, to dynamic (a permanent dynamic from DHCP server with PVE mac).
I haven't found a way to do this, my GUI allow only static IP.
How can I do that please ?

thanks a lot
 
Hi,

The DHCP for servers is not recommended. However, below you will see the example


Code:
iface enp5s0 inet manual

auto vmbr0
iface vmbr0 inet dhcp
    bridge-ports enp5s0
    bridge-stp off
bridge-fd 0


I haven't found a way to do this, my GUI allow only static IP.
How can I do that please ?
In order to set the DHCP on your Proxmox VE, you have to edit the `/etc/network/interfaces` file in the above example, you have also to change the interface name enp5s0 to your interface name. After all, you have to issue the `ifreload -a` command in order to take the effect.

Another note: when the IP of the Proxmox VE got changed, you have to edit it in the `/etc/hosts` file as well.
 
Hi all,
I'm trying to change static IP of my PVE, to dynamic (a permanent dynamic from DHCP server with PVE mac).
I haven't found a way to do this, my GUI allow only static IP.
How can I do that please ?

thanks a lot

If it is "permanent" in the sense of it being reserved in the DHCP server, just follow the standards and the official recomendation of having the IP statically configured in the Proxmox host. If you ever change your DHCP server or change the nic or mac of your Proxmox host, there's a high chance to forget that the IP is configured via DHCP, your host will get a different IP and Proxmox services will stop working properly.
 
just to close the topic (though I am not the OP), the approach suggested by @Moayad does work, and I am able to get the static lease offered by DHCP server instead of hardcoded IP in proxmox interfaces. I also edited the `/etc/hosts` and commented out the hardcoded ip (`#<ip> proxmox.local proxmox`) since the nslookup automatically adds the `.local` by default which is my local domain too.
 

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!