<tt><font size=2>Shahar Havivi <shaharh@redhat.com> wrote on 06/20/2011
08:11:43 AM:<br>
<br>
> From: Shahar Havivi <shaharh@redhat.com></font></tt>
<br><tt><font size=2>> To: Stefan Berger/Watson/IBM@IBMUS</font></tt>
<br><tt><font size=2>> Cc: libvirt-list@redhat.com</font></tt>
<br><tt><font size=2>> Date: 06/20/2011 08:13 AM</font></tt>
<br><tt><font size=2>> Subject: Re: nwfilter: limit VM traffic to specific
MAC</font></tt>
<br><tt><font size=2>> <br>
> On 20.06.11 08:02, Stefan Berger wrote:<br>
> > Shahar Havivi <shaharh@redhat.com> wrote on 06/20/2011
07:39:35 AM:<br>
> > <br>
> > > From: Shahar Havivi <shaharh@redhat.com><br>
> > > To: libvirt-list@redhat.com<br>
> > > Cc: Stefan Berger/Watson/IBM@IBMUS<br>
> > > Date: 06/20/2011 07:42 AM<br>
> > > Subject: nwfilter: limit VM traffic to specific MAC<br>
> > > <br>
> > > Hi,<br>
> > > I am trying to add custom filter to block VM traffic to
other VMs by <br>
> > limiting<br>
> > > the traffic only to the gateways MAC address.<br>
> > > The filter XML:<br>
> > > <br>
> > > <filter name='rhev' chain='root'><br>
> > >     <uuid>cd4e5890-ccc9-1b0f-303f-e7fe7123646d</uuid><br>
> > >     <filterref filter='allow-dhcp'/><br>
> > >     <rule action='drop' direction='out' priority='500'><br>
> > >         <mac match='no' dstmacaddr='$MAC'/><br>
> > >     </rule><br>
> > > </filter><br>
> > <br>
> > > <br>
> > > The MAC is not the interface MAC address it's the gateways
MAC that pass <br>
> > as a<br>
> > > parameter (I use the gateway address hardcoded as well).<br>
> > > <br>
> > > The VM is getting DHCP ip but cannot get any traffic,<br>
> > > I notice that when I edit (comment and uncomment) the drop
rule, <br>
> > thefilter is<br>
> > > working fine, ie no traffic other then the gateway.<br>
> > > <br>
> > > 1. Am I doing something wrong?<br>
> > <br>
> > Try to put the concret MAC address of the gateway into the dstmacaddr
<br>
> > field. $MAC is going to be translated to the MAC address of the
interface. <br>
> > Once it works, try using $GATEWAY_MAC and have that defined via
<parameter <br>
> > name='GATEWAY_MAC' value='a.b.c.d'/> from wherever you are
referencing the <br>
> > 'rhev' filter.<br>
> > <br>
> > The DHCP server must be running on the gateway.<br>
> Thank you Stefan,<br>
> Instead of adding 'allow-dhcp' filter, can I white list 2 mac addresses,<br>
> the gateway and the dhcp server?<br>
> <br>
> <rule action='drop' direction='out' priority='500'><br>
>     <mac match='no' dstmacaddr='$GATEWAY_MAC'/><br>
> </rule><br>
> <rule action='drop' direction='out' priority='500'><br>
>     <mac match='no' dstmacaddr='$DHCP_MAC'/><br>
> </rule></font></tt>
<br>
<br><tt><font size=2>Unfortunately that would not work. </font></tt>
<br>
<br><tt><font size=2>   Stefan</font></tt>
<br>