[Qemu-devel] [PATCH 0/1] slirp: Add domainname option to slirp's DHCP server

Benjamin Drung posted 1 patch 7 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180216125504.25955-1-benjamin.drung@profitbricks.com
There is a newer version of this series
net/slirp.c      | 7 ++++---
qapi/net.json    | 3 +++
qemu-options.hx  | 7 +++++--
slirp/bootp.c    | 8 ++++++++
slirp/libslirp.h | 2 +-
slirp/slirp.c    | 4 +++-
slirp/slirp.h    | 1 +
7 files changed, 25 insertions(+), 7 deletions(-)
[Qemu-devel] [PATCH 0/1] slirp: Add domainname option to slirp's DHCP server
Posted by Benjamin Drung 7 years, 10 months ago
Hi,

The DHCP server in QEMU does neither support specifying a domainname nor
a classless static route option [1]. I implemented the former (which was easy),
but I am not sure if and how to implement the classless static route option.

An example classless static route option configured in ISC's DHCP server look
like

  option rfc3442-classless-static-routes 24, 10, 0, 2, 10, 0, 2, 2, 16, 192, 168, 10, 0, 2, 2;

This translates to the routes:

10.0.2.0/24 via 10.0.2.2
192.168.0.0/16 via 10.0.2.2

Should the command line option just behave like the ISC's DHCP server and
allow specifying the byte stream passed to the client? E.g.

  -net staticroutes=24.10.0.2.10.0.2.2.16.192.168.10.0.2.2

Or should the command line option be simpler, but how should it be specified
then? Maybe

  -net staticroute=10.0.2.0/24via10.0.2.2,staticroute=192.168.0.0/16via10.0.2.2

I am open for your ideas.

[1] https://tools.ietf.org/html/rfc3442

Benjamin Drung (1):
  slirp: Add domainname option to slirp's DHCP server

 net/slirp.c      | 7 ++++---
 qapi/net.json    | 3 +++
 qemu-options.hx  | 7 +++++--
 slirp/bootp.c    | 8 ++++++++
 slirp/libslirp.h | 2 +-
 slirp/slirp.c    | 4 +++-
 slirp/slirp.h    | 1 +
 7 files changed, 25 insertions(+), 7 deletions(-)

-- 
2.14.1


Re: [Qemu-devel] [PATCH 0/1] slirp: Add domainname option to slirp's DHCP server
Posted by Samuel Thibault 7 years, 10 months ago
Hello,

Benjamin Drung, on ven. 16 févr. 2018 13:55:03 +0100, wrote:
> Or should the command line option be simpler, but how should it be specified
> then? Maybe
> 
>   -net staticroute=10.0.2.0/24via10.0.2.2,staticroute=192.168.0.0/16via10.0.2.2

I guess 

>   -net staticroute=10.0.2.0/24:10.0.2.2,staticroute=192.168.0.0/16:10.0.2.2

would be more mainstream.

I'm also wondering to which extent we want to extend our dhcp server,
when a tap device can be used to plug (or proxy) an actual dhcp serveR.

samuel

Re: [Qemu-devel] [PATCH 0/1] slirp: Add domainname option to slirp's DHCP server
Posted by Benjamin Drung 7 years, 9 months ago
Am Samstag, den 17.02.2018, 22:16 +0100 schrieb Samuel Thibault:
> Hello,
> 
> Benjamin Drung, on ven. 16 févr. 2018 13:55:03 +0100, wrote:
> > Or should the command line option be simpler, but how should it be
> > specified
> > then? Maybe
> > 
> >   -net
> > staticroute=10.0.2.0/24via10.0.2.2,staticroute=192.168.0.0/16via10.
> > 0.2.2
> 
> I guess 
> 
> >   -net
> > staticroute=10.0.2.0/24:10.0.2.2,staticroute=192.168.0.0/16:10.0.2.
> > 2
> 
> would be more mainstream.

Okay. I used this syntax to implement the static route support. See the
"slirp: Add classless static routes support to DHCP server" patch.

> I'm also wondering to which extent we want to extend our dhcp server,
> when a tap device can be used to plug (or proxy) an actual dhcp
> serveR.

I am using slirp's DHCP server to test custom build live images
locally. This should be simple to setup and run in contrast to our
"real" production environment with real hardware and actual DHCP
severs.

-- 
Benjamin Drung
System Developer
Debian & Ubuntu Developer

ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin

Email: benjamin.drung@profitbricks.com
URL: https://www.profitbricks.de

Sitz der Gesellschaft: Berlin
Registergericht: Amtsgericht Charlottenburg, HRB 125506 B
Geschäftsführer: Achim Weiss, Matthias Steinberg