[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] network domain name patch



Retrying- I do not think that the last one pasted correctly.


--- formatnetwork.html.in_orig 2008-09-12 23:21:18.000000000 -0400
+++ formatnetwork.html.in 2008-09-12 23:59:51.000000000 -0400
@@ -96,14 +96,26 @@

    <pre>
        ...
+ &lt;domain name="mynet.net" /&gt;
 &lt;ip address="192.168.122.1" netmask="255.255.255.0"&gt;
   &lt;dhcp&gt;
-     &lt;range start="192.168.122.2" end="192.168.122.254" /&gt;
+ &lt;host name="myhost1" mac="01:23:45:67:89:AB" ip="192.168.122.2" /&gt;
+     &lt;range start="192.168.122.3" end="192.168.122.254" /&gt;
   &lt;/dhcp&gt;
 &lt;/ip&gt;
      &lt;/network&gt;</pre>

    <dl>
+      <dt><code>domain</code></dt>
+      <dd>The <code>domain</code> element is optional.  If specified, then
+ the <code>name</code> attribute defines the default domain that will
+         be reported to hosts that request their domain via DHCP.  It also
+         makes it possible to specify a fully qualified domain
+ name (host.domain.com) for static IP address assignments. If a "#" + is specified as the domain, then the domain of the host will be used.
+         If not specified, then the guest hosts will have no domain.
+  <span class="since">Since 0.4.5</span>
+      </dd>
      <dt><code>ip</code></dt>
      <dd>The <code>address</code> attribute defines an IPv4 address in
 dotted-decimal format, that will be configured on the bridge
@@ -116,7 +128,7 @@
      <dd>Immediately within the <code>ip</code> element there is an
 optional <code>dhcp</code> element. The presence of this element
 enables DHCP services on the virtual network. It will further
- contain one or more <code>range</code> elements.
+ contain one or more <code>range</code> or <code>host</code> elements.
 <span class="since">Since 0.3.0</span>
      </dd>
      <dt><code>range</code></dt>
@@ -126,6 +138,15 @@
 must lie within the scope of the network defined on the parent
 <code>ip</code> element.  <span class="since">Since 0.3.0</span>
      </dd>
+      <dt><code>host</code></dt>
+      <dd>The <code>ip</code> attribute specifies the IPv4 addess that will
+ be assigned, via DHCP, to the guest OS using a virtual network interface with a
+        mac address matching the <code>mac</code> attribute.  The optional
+        <code>name</code> attribute will further assign the guest hostname.
+ If a domain is specified in the name attribute to create a FQDN, then + the <code>domain name</code> must also be specified, and they must match.
+        <span class="since">Since 0.4.5</span>
+      </dd>
    </dl>

    <h2><a name="examples">Example configuration</a></h2>
@@ -154,6 +175,27 @@
 &lt;/ip&gt;
      &lt;/network&gt;</pre>

+    <h3><a name="examplesNAT">Static IP based network</a></h3>
+
+    <p>
+      This example demonstrates how to assign static IPv4 addresses to
+      guest OSs.
+    </p>
+
+    <pre>
+      &lt;network&gt;
+ &lt;name&gt;default&lt;/name&gt;
+ &lt;bridge name="virbr0" /&gt;
+ &lt;forward mode="nat"/&gt;
+ &lt;domain name="mydomain.net"/&gt;
+ &lt;ip address="192.168.122.1" netmask="255.255.255.0"&gt;
+   &lt;dhcp&gt;
+     &lt;range start="192.168.122.10" end="192.168.122.254" /&gt;
+ &lt;host mac="01:23:45:67:89:ab" ip="192.168.122.2" name="myhost1.mydomain.net" /&gt; + &lt;host mac="01:23:45:67:89:ac" ip="192.168.122.3" name="myhost2.mydomain.net" /&gt;
+   &lt;/dhcp&gt;
+ &lt;/ip&gt;
+      &lt;/network&gt;</pre>
    <h3><a name="examplesRoute">Routed network config</a></h3>

    <p>

----- Original Message ----- From: "JJ Reynolds" <jjr reynoldsus net>
To: <libvir-list redhat com>
Sent: Friday, September 12, 2008 10:45 PM
Subject: Re: [libvirt] network domain name patch


Actually, it is part of libvirt. Whoever did it (sorry, I don't know who did it so cannot give them the credit they deserve) definately did the hard part and made it work. I just added the ability to have your virtuals have a FQDN.

I will work on updating the documentation if that has not already been done.

Sorry about missing the memory leak.

Thanks!

-JJ


----- Original Message ----- From: "Richard W.M. Jones" <rjones redhat com>
To: "JJ Reynolds" <jjr reynoldsus net>
Cc: <libvir-list redhat com>
Sent: Friday, September 12, 2008 4:20 AM
Subject: Re: [libvirt] network domain name patch


On Sat, Sep 06, 2008 at 03:14:45PM -0400, JJ Reynolds wrote:
This is a followup to the excellent patch which allows static IP
address assignment.  The problem with that patch is that you can
only set the host name and cannot set a FQDN because dnsmasq will,
as a security measure, not allow it unless --domain is specified.

I didn't know that anyone was using that patch (and surely it doesn't
apply cleanly to recent libvirt versions).  If this is being actively
used then it should be part of libvirt ...

Rich.

--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/

--
Libvir-list mailing list
Libvir-list redhat com
https://www.redhat.com/mailman/listinfo/libvir-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]