<div dir="ltr"><div class="gmail_quote">On Sat, Aug 2, 2008 at 11:22 PM, Fabian Deutsch <span dir="ltr"><<a href="mailto:fabian.deutsch@gmx.de">fabian.deutsch@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hey,<br>
<div class="Ih2E3d"><br>
><br>
> I'm using KVM with the wonderful help of libvir (virsh), on a<br>
> to-be-production-ready server of mine.<br>
><br>
><br>
> I would like to be able to choose on a way or another the ip of each<br>
> of my VM. As far as I can understand, the only way to get an IP (from<br>
> a vm point of view) if the dhcp it. But I have no garantee vm1 will<br>
> always get x.x.x.1 Ip adress...<br>
<br>
</div>I suppose you are speaking about the NAt-Solution.</blockquote><div><br></div><div>Yes. Sorry. My server has 1 public IP address. Host will host an Apache proxying http services hosted by VMs. VMs will have private IP addresses (192.168.0.x).</div>
<div><br></div><div>I can not have any other public IP addresses, so bridging is not a solution (AFAICU)</div><div><br></div><div>Nat seems good choice in my case, I think.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Have a look at some bridge-Solution:<br>
<a href="http://libvirt.org/formatnetwork.html#examplesRoute" target="_blank">http://libvirt.org/formatnetwork.html#examplesRoute</a></blockquote><div><br></div><div>Ok. </div><div><br></div><div>You are proposing me to use :</div>
<div><br></div><div><br></div><div><span class="Apple-style-span" style="font-family: Verdana; font-size: 13px; "><pre style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(153, 153, 153); border-right-color: rgb(153, 153, 153); border-bottom-color: rgb(153, 153, 153); border-left-color: rgb(153, 153, 153); background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(238, 238, 238); color: black; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; background-position: initial initial; ">
      <network>
        <name>local</name>
        <bridge name="virbr1" />
        <forward mode="route" dev="eth1"/>
        <ip address="<a href="http://192.168.122.1">192.168.122.1</a>" netmask="<a href="http://255.255.255.0">255.255.255.0</a>">
          <dhcp>
            <range start="<a href="http://192.168.122.2">192.168.122.2</a>" end="<a href="http://192.168.122.254">192.168.122.254</a>" />
          </dhcp>
        </ip>
      </network></pre><div><font class="Apple-style-span" face="-webkit-monospace"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" face="-webkit-monospace"><span class="Apple-style-span" style="white-space: pre;">I understand this defines a network, where IP address of host in VM-World is <a href="http://192.168.122.1">192.168.122.1</a>, and DHCP distributes IP addresses to VMs. <span class="Apple-style-span" style="font-family: '-webkit-monospace'; ">Nat is disabled ?</span></span></font></div>
<div><font class="Apple-style-span" face="-webkit-monospace"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" face="-webkit-monospace"><span class="Apple-style-span" style="white-space: pre;">I just don't understand how I can specify that VM1 (with its mac address), should have .1 IP address. Natting will be automagic ?</span></font></div>
<div><font class="Apple-style-span" face="-webkit-monospace"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" face="-webkit-monospace"><span class="Apple-style-span" style="white-space: pre;">I must admit I don't really know how to use routing system, I presume :(</span></font></div>
<div><font class="Apple-style-span" face="-webkit-monospace"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" face="-webkit-monospace"><span class="Apple-style-span" style="white-space: pre;">Thanx for your help,</span></font></div>
</span></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><a href="http://libvirt.org/formatnetwork.html#examplesRoute" target="_blank"></a><br>
<font color="#888888"><br>
<br>
- fabian<br>
</font></blockquote></div><br><div>Olivier.</div></div>