Best way to bandwidth limiting for testing purpose on Linux

2

I need simple and accurate solution to limit bandwidth in wifi network for testing purpose.

Since it will be for testing it will be used with only one device. I do not need control per device (MAC address). I think control per interface would be sufficient.

I use this simple script to crate MASQUERADE:

#!/bin/bash

ptables --table nat -F

iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE

Devices connect through second wireless interface (wlan1). It have to be accurate at low speeds (for example wlan0 is connected to AP that is connected to 5Mbps network and I would like to limit it to 64 Kbps on wlan1).

One more think, it would be sufficient if it will work only with http protocol, so I'm also thinking about using some special http proxy then using something like HTB.

Maciek Sawicki

Posted 2010-11-30T08:08:39.587

Reputation: 1 072

similar question but Windows related: http://superuser.com/questions/16081/how-to-limit-my-bandwidth-to-test-mywebsite-applications

– Maciek Sawicki – 2010-11-30T08:09:17.900

Answers

1

You should be able to do it with tc...it's built into both linux distros I use. Here's a simple example with a 1 page explanation: http://www.linux.org/docs/ldp/howto/Adv-Routing-HOWTO/lartc.ratelimit.single.html You can match almost anything and throttle different classes differently if you like.

RobotHumans

Posted 2010-11-30T08:08:39.587

Reputation: 5 758