I am trying to limit inbound and outbound bandwidth to and from a specific host on CentOS. The reason is that this host consistently uses a large amount of bandwidth and this needs to be limited while other hosts needs to be able to connect freely without limitation.

Any ideas?


The match ip rule in tc is probably your best option. A quick example for outbound:

  tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth 10mbit 

  tc class add dev $DEV parent 1: classid 1:1 cbq rate 512kbit \
  allot 1500 prio 5 bounded isolated 

  tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
  match ip dst $DESTINATION_IP flowid 1:1

You can also do match ip src for inbound.

Source: http://lartc.org/howto/lartc.ratelimit.single.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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