[pve-devel] qemu nat mode and rate limiting ?

Alexandre DERUMIER aderumier at odiso.com
Tue Mar 5 11:00:02 CET 2013


I have found some interesting article here

http://tjworld.net/wiki/Linux/KvmQemuEasyRoutedNetwork

about setting dnsmasq on tap interface:

sudo /usr/sbin/dnsmasq --interface=tap0  --except-interface=lo --bind-interfaces --user=nobody \
 --dhcp-range=vmnet,10.254.254.2,10.254.254.253,255.255.255.0,10.254.254.255,8h \
 --domain=lan.tjworld.net --pid-file=/var/run/vmnet_dnsmasq.pid --conf-file

So it should be easy to setup a dnsmasq process for each tap interface, in pve-bridge script.


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

De: "Alexandre DERUMIER" <aderumier at odiso.com> 
À: "Dietmar Maurer" <dietmar at proxmox.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Mardi 5 Mars 2013 10:54:14 
Objet: Re: [pve-devel] qemu nat mode and rate limiting ? 

>>Address with optional netmask specified in the CIDR notation (e.g. 10.3.4.5/24). 
Yes ! 

>>I guess it is easier to use 'dnsmasq': 
>> 
>>http://www.thekelleys.org.uk/dnsmasq/doc.html 
Ok, so generate the dnsmasq config file on nic update. 


I also found an interesting small dhcpd daemon, but in python 
https://code.google.com/p/staticdhcpd/downloads/detail?name=staticDHCPd-1.5.7.tar.bz2&can=2&q= 
Hacking is should be easy, it can use differents config storage backend (mysql,postgres,sqlite,..). 


>> You need to notify other hosts that the IP has moved. 

Why ? (I mean, this is the job of ARP on the network layer) 

the only thing is to remove the host->guest route on source host, 
or others vm on the source host will not be able to join the migrated vm. 



Another thing, if we migrate the vm, I think the guest must change is gateway as host ip change ? 
So, only dhcp seem to be possible ? And I don't known if the guest will submit a new dhcp request after the migration. 

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

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Alexandre DERUMIER" <aderumier at odiso.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Mardi 5 Mars 2013 10:25:47 
Objet: RE: [pve-devel] qemu nat mode and rate limiting ? 

> >>Sure, we just need to add a correct route. 
> Ok, it's clear. 
> 
> So, we need to known the guest ip. 
> 
> We should add a ip address option in guest vm config file. 

Address with optional netmask specified in the CIDR notation (e.g. 10.3.4.5/24). 

> If user don't use dhcp in his guest, he must set the same ip in the guest 
> 
> If user use dhcp in guest, 
> we can add an option to activate an dhcp server on proxmox host, 
> re-use vm config file to assign ip address 
> This dhcp server should works only inside host. 
> It could be great to have dhcp leases across the cluster. 
> 
> I don't known if it's possible to write a small dhcp server in perl ? 

I guess it is easier to use 'dnsmasq': 

http://www.thekelleys.org.uk/dnsmasq/doc.html 

or something similar. 

> >>Not sure how to handle that when we migrate a VM. 
> 
> Simply add/remove route at in qemu-migrate ? 

You need to notify other hosts that the IP has moved. 
_______________________________________________ 
pve-devel mailing list 
pve-devel at pve.proxmox.com 
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 


More information about the pve-devel mailing list