On Mon, 12 Mar 2012, Adam Williamson wrote:

> Have you guys looked at how other projects achieve similar goals? Not
> the same, but similar...the one that occurred to me is how
> virt-manager / libvirt handle it, since they need the host system to act
> as a DHCP server for guest systems. I believe libvirt uses dnsmasq for
> this. It occurs to me that dd-wrt also uses dnsmasq. So it seems like
> maybe that's a good candidate to use when you need a plug-in DHCP server
> like this.

Okay, I've come up with a proposed solution for the DHCP issue that I'm 
reasonably happy with.  It consists of the following:

1) A udev rule which kicks off a script when a usbnet device is created.

2) A script (start_usbnet_wrapper.sh) that kicks off another script in the 
background (so that we don't tie up udev).

3) Another script (start_usbnet.sh) that:
a) Stops NetworkManager from trying to configure the new interface. (Most 
distros use NetworkManager, right?)
b) Configures the interface with an IP address.
c) Kicks off a DHCP daemon to assign the remote an IP address.  I ended up 
using dnsmasq (thanks Adam for the pointer) as it is a lot simpler to 
configure (actually, no config files needed) and I'm guessing it is more 
likely to be installed on people's distros because libvirt depends on it. 
But another option could be to use the simple DHCP server that I pulled 
together, if we didn't want to require a dependency on another package.

Additionally, the script gets called when the usbnet device is removed and 
it kills off the DHCP daemon.

I've tested this out and it seems to work pretty well for me.

I created a new tracker item, files are available there:
https://sourceforge.net/tracker/?func=detail&aid=3504897&group_id=201579&atid=978127

Scott

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel

Reply via email to