<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 29, 2017 at 7:23 PM, Björn Fischer <span dir="ltr"><<a href="mailto:bf@cebitec.uni-bielefeld.de" target="_blank">bf@cebitec.uni-bielefeld.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">root@drax:/root# lxc shell moonraker<br>
</blockquote><div><br></div><div>Wow</div><div><br></div><div><div><div># lxc | egrep 'shell|exec'</div><div>  exec             Execute commands in containers</div></div></div><div><br></div><div>'shell' is not even in the lxc command line help yet :)</div><div>Thanks for letting me know that command exists.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">[ iptables rule is active but has no effect on ping in container ]<br>
------snip------<br>
<br>
Certainly I am missing something very obvious.<br>
If anyone could point me in the right direction,<br>
I would appreciate that.<br>
<br></blockquote><div><br></div><div>My GUESS is that iptables treat container traffic as separate host, due to being in separate network namespace. So the host has no idea what PID the ping traffic is from.</div><div><br></div><div>The host only knows that the traffic comes from a veth* interface, which is attached to lxdbr0, and then it needs to FORWARD it to eth0 (or whatever your host's public interfaces is). So this should work</div><div><br></div><div>iptables -I FORWARD -s <span style="font-size:12.8px">10.0.160.33</span> -p ICMP -j DROP <br></div><div><br></div><div>OUTPUT and INPUT won't work, FORWARD does. Of course, cgroups won't wont with FORWARD, so you need to find a criteria (e.g. source IP) that does.</div><div><br></div><div>-- </div><div>Fajar</div></div></div></div>