<div dir="ltr">Here: <a href="http://www.mail-archive.com/users@ovirt.org/msg06261.html">http://www.mail-archive.com/users@ovirt.org/msg06261.html</a><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/2/10 Shahar Havivi <span dir="ltr">&lt;<a href="mailto:shaharh@redhat.com" target="_blank">shaharh@redhat.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 10.02.13 16:36, Matt . wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m thinking about the way how I did that with the dedicated NIC to the VM.<br>
&gt; I was discussing this a couple of months ago on IRC but I can&#39;t remeber and<br>
&gt; I already tried to do this... no luck yet. I remember that the NICS were<br>
&gt; just available when adding a nic to the VM, by MAC-address. Can&#39;t figure it<br>
&gt; out yet what I did those except of not sleeping that much :)<br>
</div>I don&#39;t remember that, sorry...<br>
<div class="im">&gt;<br>
&gt; About the error that I get I do the following:<br>
&gt;<br>
&gt;<br>
&gt; Hosts &gt; Network Interfaces &gt; Setup Host Networks.<br>
&gt;<br>
&gt; When I drag a network I created to a NIC and I don&#39;t set an IP or DHCP or<br>
&gt; None I get that error: &quot;Error while executing action Setup Networks:<br>
&gt; Illegal or Incomplete IP Address&quot;<br>
&gt;<br>
&gt; When I set and IP to that network that is draaged to the Nic I don&#39;t get an<br>
&gt; error, but why only and IP and no GW as this is IP seems to be bridged in<br>
&gt; the host to the VM where you add a Nic to with that same network you just<br>
&gt; gave an IP.<br>
&gt;<br>
&gt; When saying the above, could have been possible that I have set the<br>
&gt; Mac-Address of the real Nic @ the VM Nic ? As this is possible that might<br>
&gt; have been the solution I used ?<br>
&gt;<br>
&gt; For the rest this software is good and the support is superb!<br>
</div>I can&#39;t reproduce this error,<br>
its look like UI validation...<br>
Alona,Moti did you encounter this error?<br>
<div><div class="h5"><br>
&gt;<br>
&gt; Thanks so far again.<br>
&gt;<br>
&gt; Matt<br>
&gt;<br>
&gt;<br>
&gt; 2013/2/10 Shahar Havivi &lt;<a href="mailto:shaharh@redhat.com">shaharh@redhat.com</a>&gt;<br>
&gt;<br>
&gt; &gt; On 10.02.13 16:16, Matt . wrote:<br>
&gt; &gt; &gt; Hi Shahar,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Thanks, I need to work this out further to have it 100% visible.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I wonder why I was able in the past (3.1) to dedicate an NIC to a VM.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Do you also have an explanation why I cannot save a network configuration<br>
&gt; &gt; &gt; with a nic in DHCP mode ? It complains about a wrong IP and I have seen<br>
&gt; &gt; it<br>
&gt; &gt; &gt; should be a bug. Is this right ?<br>
&gt; &gt; How did you that...<br>
&gt; &gt; I.e can you tell me the steps that you made in the UI? (for both cases)<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Cheers,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Matt<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; 2013/2/10 Shahar Havivi &lt;<a href="mailto:shaharh@redhat.com">shaharh@redhat.com</a>&gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; On 10.02.13 14:13, Dan Kenigsberg wrote:<br>
&gt; &gt; &gt; &gt; &gt; On Sun, Feb 10, 2013 at 12:19:57PM +0100, Matt . wrote:<br>
&gt; &gt; &gt; &gt; &gt; &gt; Hi,<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; For setting up a firewall in a VM I would like to add 2 of my 4<br>
&gt; &gt; nics<br>
&gt; &gt; &gt; &gt; &gt; &gt; directly to a VM.<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; In my previous setup I thought I have done that, but at the moment<br>
&gt; &gt; I<br>
&gt; &gt; &gt; &gt; cannot<br>
&gt; &gt; &gt; &gt; &gt; &gt; figure this out and cannot find the docs to accomplish this.<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; I would like to dedicate those 2 nics to my firewall VM&#39;s to avoid<br>
&gt; &gt; &gt; &gt; sharing<br>
&gt; &gt; &gt; &gt; &gt; &gt; them using a network per accident to other VM&#39;s.<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; How is this be done at the moment ?<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; AFAIK it can be done only with a vdsm hook. You&#39;d need to define<br>
&gt; &gt; your VM<br>
&gt; &gt; &gt; &gt; &gt; with no interface at all, but instead, mark it with a special custom<br>
&gt; &gt; &gt; &gt; &gt; property you define. Then, you should write a hook that adds the two<br>
&gt; &gt; &gt; &gt; &gt; host interfaces to the VM, by means of either<br>
&gt; &gt; &gt; &gt; &gt; <a href="http://libvirt.org/formatdomain.html#elementsNICSDirect" target="_blank">http://libvirt.org/formatdomain.html#elementsNICSDirect</a> or<br>
&gt; &gt; &gt; &gt; &gt; <a href="http://libvirt.org/formatdomain.html#elementsNICSHostdev" target="_blank">http://libvirt.org/formatdomain.html#elementsNICSHostdev</a><br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Most probably, you would need to pin your firewall VM to a specific<br>
&gt; &gt; &gt; &gt; &gt; host.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Writing a hook is not too complex, but it requires understanding of<br>
&gt; &gt; how<br>
&gt; &gt; &gt; &gt; &gt; vdsm and libvirt works. You can take<br>
</div></div>&gt; &gt; &gt; &gt; &gt; <a href="http://gerrit.ovirt.org/gitweb?p=vdsm.git;a=tree;f=vdsm_hooks/vmfexas" target="_blank">http://gerrit.ovirt.org/gitweb?p=vdsm.git;a=tree;f=vdsm_hooks/vmfexas</a> a<br>
<div class="HOEnZb"><div class="h5">&gt; &gt; &gt; &gt; &gt; reference, or ask for specific guidance here.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Dan.<br>
&gt; &gt; &gt; &gt; Dan is right,<br>
&gt; &gt; &gt; &gt; Currently you can do it via hook,<br>
&gt; &gt; &gt; &gt; We do have promisc mode but currently we have mirroring mode only (ie<br>
&gt; &gt; you<br>
&gt; &gt; &gt; &gt; can<br>
&gt; &gt; &gt; &gt; monitor each VM traffic but cannot intercept it).<br>
&gt; &gt; &gt; &gt; The way to do it is via layer 2.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; its best to implement after_vm_start hook and use ebtables.<br>
&gt; &gt; &gt; &gt; you can pass to the hook the network name.<br>
&gt; &gt; &gt; &gt; when you have the network name you can prob for its mac address and in<br>
&gt; &gt; the<br>
&gt; &gt; &gt; &gt; libvirt xml<br>
&gt; &gt; &gt; &gt; you can view the interfaces that are part of that network and get the<br>
&gt; &gt; mac<br>
&gt; &gt; &gt; &gt; addresses as well. (look at other hooks as Dan point out)<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; when you have the network name the network mac and the target<br>
&gt; &gt; interface you<br>
&gt; &gt; &gt; &gt; can use ebtables:<br>
&gt; &gt; &gt; &gt; 1. set the bridge in promisc mode<br>
&gt; &gt; &gt; &gt;    $ ifconfig &lt;netwok name&gt; promisc<br>
&gt; &gt; &gt; &gt; 2. traffic to the monitoring machine<br>
&gt; &gt; &gt; &gt;    $ ebtables -t nat -A PREROUTING -d 00:1a:4a:16:01:51 -i eth0 -j dnat<br>
&gt; &gt; &gt; &gt; --to-destination 00:1a:4a:16:01:11<br>
&gt; &gt; &gt; &gt; 3. traffic from the monitoring machine<br>
&gt; &gt; &gt; &gt;    $ ebtables -t nat -A PREROUTING -s 00:1a:4a:16:01:51 -i vnet0 -j<br>
&gt; &gt; dnat<br>
&gt; &gt; &gt; &gt; --to-destination 00:1a:4a:16:01:11<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; 1. set the network interface in promiscous mode<br>
&gt; &gt; &gt; &gt; 2. traffic that ment to the vm mac will go to the destination mac<br>
&gt; &gt; &gt; &gt; 2. traffic that sent from the vm mac will go to the destination mac<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; note that the -i &lt;interface&gt; is the interface name and I think it can<br>
&gt; &gt; be<br>
&gt; &gt; &gt; &gt; omitted...<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Shahar Havivi.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt;<br>
</div></div></blockquote></div><br></div>