[SOLVED] Can't use Internet in VMs because Proxmox assigns his very own IP to them??

evisk

New Member
Jan 13, 2025
3
0
1
Hello,

I just installed Proxmox and was eager to run my first VM. For testing purposes I grab the latest ArchLinux ISO and try to spin up the VM. I left every setting under "Network" as-is, with vmbr0 etc.

Now, when I boot the VM, as soon as the TTY shows up, I lose my connection to the Proxmox WebUI.
I didn't enable the option to boot VMs upon startup so I just pressed the power button to send the ACPi signal and shutdown. After starting the server again, the WebUI worked again, after all, the VM was not running now.
I tried to launch the VM again but this time, as soon as I saw the TTY again I quickly run < ip a > to look at the VM's IP address and ... behold, it's 7.0.0.2. The same as the Proxmox server itself. (My router is at 7.0.0.1.). So my guess is that it's conflicting ... I thought about testing this and after deleting and re-creating the VM, this time, under the "Network" selection, I opted to not add any network device. I was right, this worked. Now I wouldn't lose connection to the WebUI. I obviously need connection in my VM though, so I added the network device again but this time, not by re-creating the VM from scratch, instead, I just added the device from the VM's submenu under "Hardware". I boot up the VM again and this time the IP assigned is 7.0.0.11 !! Now it works flawlessly... even across reboots, it keeps this IP.

Now, questions: Why is this happening? Why does Proxmox assign it's own IP to VMs? Is there a way to change a VM's IP before running it, from the outside? Because I would wager to say that my current workaround is not 100% fail proof, and perhaps at some point it won't assign a right IP, at that point I will need to change the IP in another way. Obviously the best scenario would be to not having to do anything and the right IP being assigned upon VM creation. Also, I did not touch any other setting, I just started after all, so I don't understand how something like this is happening to begin with, I searched a bit around Reddit/Youtube and this forum too, but I did not stumble upon anyone having the same issue as me.
 
PVE uses DHCP during install to obtain an ip address but later on it's assigned statically. Since it's within DHCP range and not renewed your router considers it free to be re-used after some time and assigns it to other devices. In this case your VM because it's not leased to anything else.
To fix this you should reserve the ip of the node in your router even If it doesn't use DHCP. This usually also allows you to resolve the node's name via DNS. Ideally you do that and also pick an ip outside of the DHCP range. I feel like the docs should hint towards that. Some assumptions have been made to answer this.
 
Last edited:
  • Like
Reactions: evisk and UdoB
My router is at 7.0.0.1
Cool :cool:

Code:
~# whois 7.0.0.0

NetRange:       7.0.0.0 - 7.255.255.255
NetName:        DISANET7

Organization:   DoD Network Information Center (DNIC)
 
Cool :cool:

Code:
~# whois 7.0.0.0

NetRange:       7.0.0.0 - 7.255.255.255
NetName:        DISANET7

Organization:   DoD Network Information Center (DNIC)

well yeah, not in the open internet, but under my network, it's at that address
 
PVE uses DHCP during install to obtain an ip address but later on it's assigned statically. Since it's within DHCP range and not renewed your router considers it free to be re-used after some time and assigns it to other devices. In this case your VM because it's not leased to anything else.
To fix this you should reserve the ip of the node in your router even If it doesn't use DHCP. This usually also allows you to resolve the node's name via DNS. Ideally you do that and also pick an ip outside of the DHCP range. I feel like the docs should hint towards that. Some assumptions have been made to answer this.
alright thank you, will reserve the address then