Linux – Limit rate of outgoing UDP packets per second

debianlinuxudp

since Teamspeak version 3 sends lots of packets per user and our provider is getting problems with his infrastructure above 20.000 packets per second we have to limit it that our servers are not going to be shut down.

Red a lot about iptables but was not able to find the right rules. Could you give me an advise how to manage that the server is not going to send more than 19k packets per seconds?

We are running on debian 4

Thanks in Advance
Tim

Best Answer

You have a couple of options. iptables and traffic shaping. For iptables, check out the how-to. In the Filtering Specifications section there is an example of using the Limit Extension to limit traffic.

The other option is traffic shaping, which can be (is?) complicated. Take a look at the Linux Advanced Routing & Traffic Control HOWTO for an introduction, in particular chapter 9.

Another option is to tune TeamSpeak. Try changing the codec used to one that is of a lower quality. I believe the TeamSpeak client has bandwidth limiting options. See if the server does too.