<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Thu, 22 Mar 2012 11:43:03 -0700<br>Subject: Re: [libvirt] Problem with Open vSwitch and dnsmasq<br>From: aatteka@nicira.com<br>To: dano1988@hotmail.it<br>CC: libvir-list@redhat.com; roberto.sassu@polito.it; paolo.smiraglia@polito.it; dev@openvswitch.org<br><br><br><br><div class="ecxgmail_quote">On Thu, Mar 22, 2012 at 11:11 AM, Daniele Milani <span dir="ltr"><<a href="mailto:dano1988@hotmail.it">dano1988@hotmail.it</a>></span> wrote:<br><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">



<div><div dir="ltr">
I think I could try the first solution. Can you explain me how do I create the port used by dnsmasq?<br><br>For example, is it correct to execute <br># ovs-vsctl add-port virbr1 port2 tag=2<br>to create a port for the vLan whose tag is 2 named "port2"?<br>
</div></div></blockquote><div><br>Try something like this:<br><blockquote style="padding-left:1ex" class="ecxgmail_quote">ovs-vsctl add-port virbr1 port2 tag=2<br>
ovs-vsctl set Interface port2 type=internal <br>ifconfig port2 10.0.0.1<br>ifconfig port2 up<br>/usr/sbin/dnsmasq --strict-order --bind-interfaces --except-interface lo --listen-address 10.0.0.1 --dhcp-range 10.0.0.10,10.0.0.20 --dhcp-leasefile=/var/lib/libvirt/dnsmasq/vlan2.leases --dhcp-lease-max=253 --dhcp-no-override<br>
</blockquote>Though I have not tested it...<br></div><div><br></div><div><pre style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap !important; word-wrap: break-word; font-size: 12px; background-color: rgb(255, 255, 255); "><br class="Apple-interchange-newline">
I tried the configuration you suggest; and the request is now received by dnsmasq.</pre><pre style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap !important; word-wrap: break-word; font-size: 12px; background-color: rgb(255, 255, 255); ">
I executed:</pre><pre style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap !important; word-wrap: break-word; font-size: 12px; background-color: rgb(255, 255, 255); ">
ifconfig port2 192.168.100.128 netmask 255.255.255.0
ifconfig port2 up
/usr/sbin/dnsmasq --strict-order --bind-interfaces --except-interface lo
--listen-address 192.168.100.128 --dhcp-range 192.168.100.129,192.168.100.139 --dhcp-leasefile=/var/lib/libvirt/dnsmasq/vlan2.leases --dhcp-lease-max=11 --dhcp-no-override --log-queries --log-facilities=/path_to_my_file/my_file 
tailf /path_to_my_file/my_file

obtaining the following output:
dnsmasq-dhcp[]: DHCPDISCOVER(port2) 52:94:00:02:a7:1e
dnsmasq-dhcp[]: DHCPOFFER(port2) 192.168.100.129 52:94:00:02:a7:1e
...
dnsmasq-dhcp[]: DHCPDISCOVER(port2) 52:94:00:02:a7:1e
dnsmasq-dhcp[]: DHCPOFFER(port2) 192.168.100.129 52:94:00:02:a7:1e
...</pre><pre style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre-wrap !important; word-wrap: break-word; font-size: 12px; background-color: rgb(255, 255, 255); ">
Now I have a different problem: none DHCP Offer is sent by port2.

Do someone know why does it happen and what to do about it?

Thanks,
Daniele Milani</pre></div><blockquote class="ecxgmail_quote" style="padding-left:1ex"><div><div dir="ltr"><br>Daniele Milani<br><br><br>
<div>Date: Thu, 22 Mar 2012 10:54:21 -0700<br>Subject: Re: [libvirt] Problem with Open vSwitch and dnsmasq<br>From: <a href="mailto:aatteka@nicira.com">aatteka@nicira.com</a><br>To: <a href="mailto:dano1988@hotmail.it">dano1988@hotmail.it</a><br>
CC: <a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a>; <a href="mailto:roberto.sassu@polito.it">roberto.sassu@polito.it</a><div><div class="h5"><br><br><br><br><div>On Thu, Mar 22, 2012 at 6:10 AM, Daniele Milani <span dir="ltr"><<a href="mailto:dano1988@hotmail.it">dano1988@hotmail.it</a>></span> wrote:<br>
<blockquote style="border-left:1px #ccc solid;padding-left:1ex">
<div><div>


<div><div dir="ltr">
Dear all,<br>I have the following situation:<br>-I replaced the standard bridge driver with the Open VSwitch one;<br>-I started a NAT-network on Libvirt (bridge name virbr1);<br>-I started a Virtual Machine (VM1) on Libvirt, and I tagged his interface (vnet0) with tag=2;<br>

-if I run "# ovs-vsctl show" I obtain:<br><br>Bridge "virbr1"<br>        Port "vnet0"<br>            tag: 2<br>            Interface "vnet0"<br>        Port "virbr1-nic"<br>

            Interface "virb1-nic"<br>        Port "virbr1"<br>            Interface "virbr1"<br>                type: internal<br><br>-the problem is that it is impossible to assign to VM1 an IP, because the dnsmasq daemon does not accept the tagged DHCP Discover frame.<br>

<br>Does someone know if there is a way for dnsmasq to accept tagged frames through "virbr1", and send a tagged DHCP Offer packet back to VM1?<br><br></div></div></div></div></blockquote><div>I believe you would need to run dedicated dnsmasq process instance per each VLAN that you have. By<br>

default I guess dnsmasq runs on virbr1, hence it does not see the tagged traffic that comes from vnet0.<br><br>You could try to:<br><ol><li>add another port to that bridge with the same VLAN as VM has. And run a separate instance of dnsmasq there; or</li>
</ol><br><br><br>change the tag of virb1 port, but this might lead to other issues (e.g. then non-tagged VMs will not get DHCP leases).<br>Perhaps someone else can suggest something easier...<br><br></div><blockquote style="padding-left:1ex">

<div><div><div><div dir="ltr">Greetings,<br>Daniele Milani<br><br>                                    </div></div>
</div></div><br>--<br>
libvir-list mailing list<br>
<a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvir-list" target="_blank">https://www.redhat.com/mailman/listinfo/libvir-list</a><br></blockquote></div><br></div></div></div>                                      </div></div>
</blockquote></div><br></div>                                     </div></body>
</html>