Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am wondering if it is possible to create a bandwidth shaping/throttling script that shapes traffic based on user group. That is, if user1, user2, are in user group group1, they will have 1mb/s download and 1mb/s upload, whilst if user3 and user4 are in group2, they will have 256kb/s download and 256kb/s upload.

I've read a bit about this and I found some iptables and TC implementations of a per user solution, but I have not seen anything for a user group.

Hopefully it can be simply implemented in form of a custom iptables rules and script running with TC or the like. Here is a script I was looking into that does a system wide throttle: http://atmail.com/kb/2009/throttling-bandwidth/

I assume it is possible to do user group throttling since it is possible for throttling on a per user basis.

Thanks for any info you can provide for this question.

share|improve this question

Look — man iptables mentions module owner which allows to select packets related to users/groups but only outgoing ones (OUTPUT and POSTROUTING) but since Linux' netfilter also has rather excellent connection tracking support you can bring into the game module connmark and have separated corresponding ingress traffic as well.

share|improve this answer
Hi, thanks for the comment. This is going to be for limiting traffic for ssh tunnels, so I assume if I limit the user groups outgoing bandwidth their tunnels bandwidth will also throttle. Thanks for this I will research more into the owner module. – RobReylen Nov 1 '13 at 19:16
@RobReylen, yep, feel free to hire in case you need this tried ASAP – poige Nov 2 '13 at 4:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.