Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an interent connection with the speed of 4000k bits up and down. I want to do port based traffic shaping on a ubuntu machine, which acts as router. eth0 is the WAN interface. This is how I would like to allocate bandwidth:

  • For ports 80 and 443 the bandwidth usage can go upto 90%
  • For ports above 1024 upto 65535 the bandwidth usage can go upto 10%
  • For remaining ports the bandwidth usage can go upto 40%

The easiest way for achieving the above is using a router with tomato firmware. I have used it and it is very efficient. I want to try if it can be done on a Ubuntu or any GNU/Linux machine. I have googled extensively about the topic and I feel there isn't much information.

share|improve this question
    
You have port tcp/445 (microsoft-ds) traffic going to the Internet? Or did you mean 443? –  Zoredache Mar 2 '11 at 17:34
    
See this if you haven't seen it already. lartc.org –  Zoredache Mar 2 '11 at 17:35
    
Yes, I meant 443. –  nixnotwin Mar 3 '11 at 1:33
add comment

2 Answers

up vote 0 down vote accepted

You should be able to accomplish this using tc and iptables. This article by Vivek Gite walks you through doing it for one port.

share|improve this answer
add comment

I wrote this blog post below 8 years ago for FreeBSD using DUMMYNET add-on to ipfw. It was only IP based traffic shaping (not port-based) but I assume by now there's a port to Ubuntu that supports TCP ports as well. Scroll past all the noob stuff if your a kernel rebuilding master to see how DUMMYNET concepts work and rulesets.

http://www.fishbrains.com/2003/08/25/controlling-bandwidth-for-your-wireless-network-using-freebsd-and-dummynet/

share|improve this answer
add comment

Your Answer

 
discard

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.