<html><body>
<p><tt><font size="2">David Stevens/Beaverton/IBM wrote on 10/27/2011 02:51:18 PM:<br>
<br>
<br>
> Stefan Berger <stefanb@linux.vnet.ibm.com> wrote on 10/25/2011 05:50:09 AM:<br>
> <br>
> > The below algorithm also seems to assume that the VM does not send <br>
> > 802.1Q (VLAN) headers. I remember having had problems when trying to <br>
> > receive 802.1Q headers when the VM's interface is on a bridge and the <br>
> > remote traffic comes through the network. I wonder whether it generally <br>
> > doesn't work. I think at least in the code you should look at the <br>
> > header, check for ETHERTYPE_IPv4 and then use eh_data[0], otherwise <br>
> > either discard it or if ETHERTYPE_VLAN (0x8100) is used read the <br>
> > encapsulated protocol ID and make sure ETHERTYPE_IPv4 is found there and <br>
> > then use eh_data[4] for further processing.</font></tt><br>
<tt><font size="2">> <br>
> Stefan,</font></tt><br>
<tt><font size="2">>  I added code similar to what you had, but when trying to test it,</font></tt><br>
<tt><font size="2">> I realized that this cannot work with the existing filters. It appears</font></tt><br>
<tt><font size="2">> to me that if a VLAN header is present, that packet won't match any of</font></tt><br>
<tt><font size="2">> the protocols supported and will be dropped (ETHERTYPE_VLAN won't match</font></tt><br>
<tt><font size="2">> IPv4, ARP, RARP, etc). If so, then decoding a VLAN DHCP ACK does no good</font></tt><br>
<br>
<tt><font size="2">So that sounds like an ebtables problem then not being able to handle ethernet packets with a VLAN header.</font></tt><br>
<br>
<tt><font size="2">> because the VM will never see it, and the rules will never even check a</font></tt><br>
<tt><font size="2">> source IP address for a packet that ebtables won't match as an IP packet.</font></tt><br>
<tt><font size="2">>  Right?</font></tt><br>
<br>
<tt><font size="2">You're right. Implementation-wise I still think you should look at the Ethernet header and</font></tt><br>
<tt><font size="2">check for ETHERTYPE_IPV4 to get the offset for the payload and for now skip all other types</font></tt><br>
<tt><font size="2">of packets. One could setup VMs on the same host, have their interfaces connected to a bridge</font></tt><br>
<tt><font size="2">and have them talk via VLAN and possibly provoke errors in the packet parser(s).</font></tt><br>
<br>
<tt><font size="2">The conclusion is that VMs sending VLAN traffic themselves is not supported. If a bridge has</font></tt><br>
<tt><font size="2">a VLAN interface of the host for sending/receiving VLAN traffic to/from the physical</font></tt><br>
<tt><font size="2">network, the filtering still works as expected.</font></tt><br>
<br>
<tt><font size="2">> <br>
>  I saw later your post for VLAN filtering. I haven't played with</font></tt><br>
<tt><font size="2">> vlans much, and especially not with ebtables filtering of vlans. If</font></tt><br>
<tt><font size="2">> we cannot apply the higher-layer protocol rules without making a</font></tt><br>
<tt><font size="2">> complete copy of all of them for VLANs, then I'm not sure I see the</font></tt><br>
<tt><font size="2">> point in having address learning decode VLAN headers.</font></tt><br>
<br>
<tt><font size="2">That's fine then.</font></tt><br>
<br>
<tt><font size="2">>  For the "no spoofing" case, allowing all VLAN packets is clearly</font></tt><br>
<tt><font size="2">> not right, so it appears to me that the current nwfilters simply do</font></tt><br>
<tt><font size="2">> not support the presence of VLANs.</font></tt><br>
<br>
<tt><font size="2">Yes, VLAN traffic directly from the VM is not supported with the example</font></tt><br>
<tt><font size="2">filters and has limitations when trying to evaluate the packets. The VLAN</font></tt><br>
<tt><font size="2">support I posted can serve other purposes.</font></tt><br>
<br>
<tt><font size="2">>  I can leave the current (untested) address matching checks in. It</font></tt><br>
<tt><font size="2">> doesn't hurt the non-VLAN case, if you see some way of adding full VLAN</font></tt><br>
<tt><font size="2">> no-spoofing support in the future. But unless I'm missing something, it</font></tt><br>
<tt><font size="2">> doesn't look to me like the VLAN case works at all now and not supporting</font></tt><br>
<tt><font size="2">> that in DHCP snooping is not a new problem.</font></tt><br>
<br>
<tt><font size="2">Agreed.</font></tt><br>
<br>
<tt><font size="2">   Stefan</font></tt><br>
<br>
<tt><font size="2">> <br>
>         +-DLS</font></tt></body></html>