<div dir="ltr">It's my understanding that the model is passing the packets back down to a virtual switch (an emulated switch within the kernel) and then back up a networking stack within the container's view.<div><br>
</div><div>Therefore you need to investigate solutions that would work across a real network as well. Have you considered looking in to v-lan tagging?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Aug 26, 2014 at 6:18 AM, Norman Meilick <span dir="ltr"><<a href="mailto:lxc-users@ml.irq0.de" target="_blank">lxc-users@ml.irq0.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
in my containers, I'm trying to filter packets using marks set by ebtables<br>
on the host, but it seems those marks are not propagated to the<br>
containers, and I wonder if there is a way to make it work.<br>
<br>
Example:<br>
I have a host with several physical NICs (e.g., intranet1, intranet2, wifi,<br>
extranet) that are all members of the bridge "mybridge".<br>
<br>
Containers are configured with one network interface (veth) that also<br>
becomes a member of "mybridge".<br>
<br>
Incoming packets on the host are marked depending on the physical<br>
interface they arrived on:<br>
<br>
ebtables -t nat -A PREROUTING -i intranet1 -j mark --set-mark 0x1<br>
ebtables -t nat -A PREROUTING -i intranet2 -j mark --set-mark 0x1<br>
ebtables -t nat -A PREROUTING -i wifi -j mark --set-mark 0x2<br>
ebtables -t nat -A PREROUTING -i extranet -j mark --set-mark 0x3<br>
<br>
Alas, when the packet arrives at the respective container, the<br>
mark is gone; I verified this via:<br>
<br>
iptables -A INPUT -j NFLOG --nflog-group 20<br>
tshark -i nflog:20 -n -V | grep NFULA_MARK<br>
<br>
Having a way to filter by incoming interface while keeping it<br>
simple by only having one virtual NIC would majorly simplify<br>
and unify firewalling inside my containers.<br>
<br>
I suspect the marks not being propagated is a feature of the<br>
network namespace, but maybe there's a way around that.<br>
<br>
Thanks in advance for any ideas...<br>
Norman<br>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></blockquote></div><br></div>