LXC not getting reserved IP from DHCP server on boot

benjivm

Member
Jan 4, 2021
1
0
6
125
Hello, my DHCP server is running Windows Server 2012 and whenever my PVE containers (re)boot they receive a different IP address despite having a reservation on the DHCP server (using the container's MAC address as shown in PVE > LXC > Network).

Executing the following in the container fixes the problem:
Bash:
# Wrong IP
ip addr show

# Release/renew
dhclient -r
dhclient

# Fixed now
ip addr show

How can I fix this?
 
I would guess that there is a fixed address configured. Do they always get the same wrong address or is it indeed a dhcp address lease?
 
I had the same problem. In my case the DHCP-Server is part of a Windows Server. So I cheched my Windows Server DHCP. The MAC-Address in the lease looked like:
e08d289e00010001282adb7e9661e0aa289e

It should have looked like:
9661e0aa289e

So I created a reservation for the wrong mac-address "e08d289e00010001282adb7e9661e0aa289e" and - funny enough - the lease looks like 9661e0aa289e in the sever.

This works for me for the moment: Check your (wrong) mac-address in the lease of your DHCP-Server. Put this (wrong) mac-address into your reserveration.

Maybe I am still doing something wrong. If not, a fix would be great.