[Lxc-users] cgroup.net_cls and tc

Andre Nathan andre at digirati.com.br
Mon Feb 14 17:41:45 UTC 2011


Hello

I'm trying to setup bandwidth limiting for my container, using the
examples in RedHat's whitepaper:

  http://vger.kernel.org/netconf2009_slides/Network%20Control%20Group%
20Whitepaper.odt

The container is configured with the following line:

  lxc.cgroup.net_cls.classid = 0x10002

And I have the following tc rules:

  tc qdisc add dev eth0 root handle 1: htb default 30
  tc class add dev eth0 parent 1: classid 1:2 htb rate 1mbit
  tc filter add dev eth0 protocol ip parent 1:0 prio 1 handle 1: cgroup

This should cause the 'cgroup' in the 'tc filter' command to match with
the 'classid 1:2' in the 'tc class' command, right? It doesn't seem to
work though. I got tc to work by matching the container's IP address,
but using cgroup would be easier, because one filter command would be
enough for multiple containers.

I also trying the same commands on br0 instead of eth0, but there was no
effect.

Is anyone doing something similar to this?

Thanks in advance,
Andre






More information about the lxc-users mailing list