Hi,
I'm testing SDN DHCP on Proxmox VE 9.2.3 following the official documentation:
https://pve.proxmox.com/wiki/Setup_Simple_Zone_With_SNAT_and_DHCP
Environment
Zone:
simple: local
ipam pve
dhcp dnsmasq
VNet:
vnet: net172
zone local
Subnet:
subnet: local-172.20.21.0-24
vnet net172
dhcp-range start-address=172.20.21.2,end-address=172.20.21.254
gateway 172.20.21.1
snat 1
The bridge interface is correctly created:
net172: 172.20.21.1/24
Problem
VMs connected to the SDN VNet never receive a DHCP lease.
Packet capture shows DHCPDISCOVER packets reaching the bridge:
DHCPDISCOVER from VM
but no DHCPOFFER is ever sent.
dnsmasq logs
DHCP, static leases only on 172.20.21.0, lease time infinite
cannot read /etc/dnsmasq.d/local/ethers: No such file or directory
DHCPDISCOVER(net172) xx:xx:xx:xx:xx:xx ignored
Generated dnsmasq configuration
Proxmox generates:
dhcp-hostsfile=/etc/dnsmasq.d/local/ethers
dhcp-ignore=tag:!known
dhcp-range=set:local-172.20.21.0-24,172.20.21.0,static,255.255.255.0,infinite
dhcp-option=tag:local-172.20.21.0-24,option:router,172.20.21.1
interface=net172
Findings
Looking at:
/usr/share/perl5/PVE/Network/SDN/Dhcp/Dnsmasq.pm
I found:
push @{$config}, "dhcp-range=set:$tag,$network,static,$mask,infinite";
which appears to intentionally generate static leases only.
The configured DHCP range:
172.20.21.2 - 172.20.21.254
is not reflected in the generated dnsmasq configuration.
Workaround
If I manually create:
/etc/dnsmasq.d/local/ethers
and add:
bc:24:11:05:ba:67,172.20.21.10
then restart dnsmasq, the VM successfully receives a DHCP lease.
Question
Is this the expected behavior for SDN DHCP with ipam pve in Proxmox VE 9?
If so, how are dynamic DHCP leases supposed to be allocated and how is the ethers file expected to be populated automatically?
Or is this a regression/bug where DHCP ranges are not being translated into dynamic dnsmasq pools?
Thanks.
I'm testing SDN DHCP on Proxmox VE 9.2.3 following the official documentation:
https://pve.proxmox.com/wiki/Setup_Simple_Zone_With_SNAT_and_DHCP
Environment
- Proxmox VE 9.2.3
- libpve-network-perl 1.6.6
- dnsmasq 2.91
- Single-node setup
Zone:
simple: local
ipam pve
dhcp dnsmasq
VNet:
vnet: net172
zone local
Subnet:
subnet: local-172.20.21.0-24
vnet net172
dhcp-range start-address=172.20.21.2,end-address=172.20.21.254
gateway 172.20.21.1
snat 1
The bridge interface is correctly created:
net172: 172.20.21.1/24
Problem
VMs connected to the SDN VNet never receive a DHCP lease.
Packet capture shows DHCPDISCOVER packets reaching the bridge:
DHCPDISCOVER from VM
but no DHCPOFFER is ever sent.
dnsmasq logs
DHCP, static leases only on 172.20.21.0, lease time infinite
cannot read /etc/dnsmasq.d/local/ethers: No such file or directory
DHCPDISCOVER(net172) xx:xx:xx:xx:xx:xx ignored
Generated dnsmasq configuration
Proxmox generates:
dhcp-hostsfile=/etc/dnsmasq.d/local/ethers
dhcp-ignore=tag:!known
dhcp-range=set:local-172.20.21.0-24,172.20.21.0,static,255.255.255.0,infinite
dhcp-option=tag:local-172.20.21.0-24,option:router,172.20.21.1
interface=net172
Findings
Looking at:
/usr/share/perl5/PVE/Network/SDN/Dhcp/Dnsmasq.pm
I found:
push @{$config}, "dhcp-range=set:$tag,$network,static,$mask,infinite";
which appears to intentionally generate static leases only.
The configured DHCP range:
172.20.21.2 - 172.20.21.254
is not reflected in the generated dnsmasq configuration.
Workaround
If I manually create:
/etc/dnsmasq.d/local/ethers
and add:
bc:24:11:05:ba:67,172.20.21.10
then restart dnsmasq, the VM successfully receives a DHCP lease.
Question
Is this the expected behavior for SDN DHCP with ipam pve in Proxmox VE 9?
If so, how are dynamic DHCP leases supposed to be allocated and how is the ethers file expected to be populated automatically?
Or is this a regression/bug where DHCP ranges are not being translated into dynamic dnsmasq pools?
Thanks.