You could use something like:
# limit outbound smtp traffic to 1M
iptables -A OUTPUT -p tcp --dport 25 -m limit --limit 67/sec -j ACCEPT
iptables -A OUTPUT -p tcp --dport 25 -j DROP
# limit outbound http traffic to 5M
iptables -A OUTPUT -p tcp --sport 80 -m limit --limit 333/sec -j ACCEPT
iptables -A OUTPUT -p tcp --sport 80 -j DROP
The top one will restrict the sending of smtp mail to 1Mbit/s and http replies to 5Mbit.
The limit is packets per second, the above is based on a network interface with an MTU of
1500.
If you're wanting to limit inbound too you'll want to add these rules to the INPUT chain
too.
For each pair of rules, the first one will match and accept until the --limit is reached,
above that the packets will be dropped which will cause retransmission.
Source:
http://moze.koze.net/?p=46