VE_Host (web interface) setup for DHCP

Greetings. Thanks for reading.

Just to make sure if the current shipping version actually supports "DHCP" for setup. I mean, I successfully setup everything with fixed IP then now I'd like to switch over the same install using "DHCP" for the host ("dom0") with web interface and so on.

Would you recommend how to switch over a live system instead of just trying install again from scratch? Appreciated.

Best,
 
Hi,

Yes it does, actually the only way to switch a Proxmox VE node to dhcp would be 'live', as the installer just uses static addresses as DHCP is really uncommon for servers.

To switch the whole node to DHCP open the file /etc/network/interfaces with an editor of your choice (vim.tiny, nano are installed on PVE per default)
And change the vmbr0 bridge to dhcp, it should look something like:
Code:
# ...
iface eth0 inet manual

auto vmbr0
iface vmbr0 inet dhcp
  bridge_ports eth0
  bridge_stp off
  bridge_fd 0
# ...

So, delete the address, gateway, netmask part and change inet static to inet dhcp, then save and reboot. Or do ifdown vmbr0 && ifup vmbr0

You have to know that we DHCP the server may switch IP after each reboot, and so does the PVE webinterface then, if you have no real reason for DHCP i would let it as a static address, then you always know where the server is located :)
 
  • Like
Reactions: jeanjacques
Only when you set an fixed address over MAC, PVE is useable with dhcp. Because it needs an hostsentry with his own address. Did you hasn't this, PVE is booting not correctly anymore. It does not matter when you use it only as storage device...
 
Thanks for both comments. I did follow this DEBIAN basic network config before but for some reason it didn't show up for my "DHCP" server first time.

As also suggested, I added the "static mapping" entry at "DHCP server" and now I'm satisfied with the results. The main host with web interface and so on follows my "DHCP" mapping as desired.

I noticed however about the welcome message for the host at main terminal ("Welcome to the Proxmox Virtual Environment. Please... connect to:") and the IP address doesn't update. In my case still showing the first fixed IP defined at installation.

Thanks. Fernando.
 
You can change to something like you: "/etc/issue" When you change an static configuration at the webinterface and reboot the server, then this entry will be changed too.
 
Fernando, can you post the final interfaces file that ended up working for you?
 
Since this is the first result when googling "proxmox dhcp", I thought I'd dump some info here on this. First, the interfaces file:
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto vmbr0
iface vmbr0 inet dhcp
    bridge-ports eth0
Secondly, this script I wrote for setting up proxmox servers with dhcp. On a fresh debian stable install, this script installs proxmox and sets up that interface file. I've only ever used it on systems with one ethernet port, so ymmv with the automatic bridge setup. I plan to add a nat interface to this script so I can use it on my kvm vps as well.
https://gist.github.com/sugoidogo/4684e4659431e17d15be20171160c1f9
 
  • Like
Reactions: eugrus
got here as it is the top link in Google for this subject.

I would vote to make using DHCP easier to configure via GUI - it's now common practise to set individual ports on a Server to DHCP and then use the DHCP Server to set the IPs.
This means that you never lose connectivity if there's a network change that you don't control...
 
I would vote to make using DHCP easier to configure via GUI - it's now common practise to set individual ports on a Server to DHCP and then use the DHCP Server to set the IPs.
This means that you never lose connectivity if there's a network change that you don't control...
YES! Or move your Tiny Proxmox server to another location for a while!

Any progress on this?
This would be a little progress to leave Proxmox's tinkering stage !
e.g.
1650834737674.png
What do you think?
 
Last edited:
I created a second Linux Bridge and trying to set it up to support DHCP assignment as have a card I'm binding to it that uses DHCP. Presents as enp8s0 on the host OS. I tried the bridge with and without the IP range as can't figure out how the DHCP assignment is going to know what to assign to devices. Want it in the 192.168.200.x range.

When I do an ifdown vmbr1 and ifup it hangs for a while on the up and returns

error: vmbr1: dhclient: timeout failed to detect new ip addresses

Here is what I have with the IP range but also tried without:

auto vmbr1
iface vmbr1 inet dhcp
address 192.168.200.0/24
bridge-ports enp8s0
bridge-stp off
bridge-fd 0
 
@jriker Are you trying to set up the bridge to be a dhcp client or as a dhcp server? Setting iface vmbr1 inet dhcp tells the interface to request an address and act as a client. From your comment though it sounds like you want to set up a dhcp server that gives out addresses....
 

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!