[pve-devel] implementation of a dhcp service in proxmox ?

Alexandre DERUMIER aderumier at odiso.com
Wed May 22 06:50:20 CEST 2013


> But we need also a way to configure bridge ip for vlan bridges (vmbrXvX). 

>>I don't think it makes sense to configure VLANS for routed bridges. You can use 
>>different bridges instead? 

I was talking about current bridge mode, when we choose a bridge with vlan. (no nat, no routed).
Currently we simplŷ copy the the parent bridge , to create a new bridge.

But I think you are right,If we want a dhcp,we need to defined manually 1 bridge by vlan with ip.
(Maybe It could be great to be able to defined a vmbrXvX manually in /etc/network/interfaces) 



about dnsmasq, I have done tests, with this setup, 2 bridges, 1 guest with 1 nic on each bridge

auto vmbr2 
iface vmbr2 inet static 
bridge_ports none 
bridge_stp off 
bridge_fd 0 
address 192.168.10.1 
netmask 255.255.255.0 


auto vmbr3 
iface vmbr3 inet static 
bridge_ports none 
bridge_stp off 
bridge_fd 0 
address 192.168.20.1 
netmask 255.255.255.0 


with this dnsmasq command line:

/usr/sbin/dnsmasq --log-queries --user=daemon --except-interface=lo --bind-interfaces --dhcp-range=192.168.10.10,192.168.10.20,255.255.255.0,192.168.10.255,infinite  --dhcp-range=192.168.20.10,192.168.20.20,255.255.255.0,192.168.20.255,infinite --domain=odiso.net --conf-file

	
virtual interface on vmbr2, get corretcly an ip in 192.168.10.0/24
virtual interface on vmbr3, get corretcly an ip in 192.168.20.0/24


So dnsmasq simply allocated range, depend of the source ip which receive the dhcp packets.

So 1 dnsmasq daemon can do the job. 
Maybe command line will be too long with a lot of ranges and ip.
Maybe can we generate the dnsmasq config file from proxmox configuration files before reload the dnsmasq deamon ?


Note: 
Seem that they are a bug somewhere in virtio driver, I have udp checksum error in my guests, with dhcp queries,
to resolve them, I need to use this iptables rules in host:

iptables -A POSTROUTING -t mangle -p udp --dport bootpc -j CHECKSUM --checksum-fill


----- Mail original ----- 

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Alexandre DERUMIER" <aderumier at odiso.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Mardi 21 Mai 2013 20:03:48 
Objet: RE: [pve-devel] implementation of a dhcp service in proxmox ? 

> And for dhcp with nat ? (plug the tap on a bridge with an ip for the dhcp server ?) 

There are no special needs for that. 

> >> We just need to start/configure a dhcp server listening on the bridge (also 
> with post-up/post-down)? 
> 
> Yes, it can be done with post-up/post-down. (But maybe only 1 dnsmasq 
> daemon is needed,need to be tested) 
> 
> But we need also a way to configure bridge ip for vlan bridges (vmbrXvX). 

I don't think it makes sense to configure VLANS for routed bridges. You can use 
different bridges instead? 

> And we need to define dhcp ranges for differents bridge somewhere. 

We can just define an new bridge attribute for /etc/network/interfaces, and define 
our own start/stop script. 

> Another thing, if we need to assign dynamic ip, I don't known how to manage 
> dhcp leases across the cluster, if we have 1 dnsmasq daemon by node. 

no idea, sorry. 


More information about the pve-devel mailing list