On my previous article I talked about how I’ve upgraded from DD-WRT to Tomato and how much of an improvement it was over DD-WRT. While I’m still tweaking my setup I thought I’d provide a quick tutorial on how to setup QoS in Tomato.
For those of though who don’t know, QoS (Quality of Service) provides different priorities to different users or data flows, or it can guarantee a certain level of performance to a data flow in accordance with requests from the application program or the internet service provider policy. In Tomato’s case we are going to set it up to give priority to data flows. In a nutshell QoS tries to guarantee that important network protocols are given priority over non-important protocols. For example, http has priority over BitTorrent.
I’d like to start off my mentioning that there isn’t just one correct way to setup QoS. This guide is only intended to give you a basic idea on how to setup your own.
TOMATO QoS CONFIGURATION
Enabling QoS
- Log into your router (default IP is 192.168.1.1) by opening up your web browser and going to http://192.168.1.1.
- On the left side, click on QoS and it will open up the Basic Settings.Now click the checkbox to Enable QoS.

- I changed some of the default settings. A large amount of my bandwidth is usually dedicated to P2P, mainly BitTorrent (only legal stuff, I swear).
- I unchecked Prioritize ACK. BitTorrent sends many ACK packets and if you tend to use BitTorrent a lot, the router can get flooded with ACK requests. If you don’t use any type of BitTorrent client, you can leave this checked.NOTE: This is somewhat debatable. Some people argue that ACK packets only take up a small amount of bandwidth, and because they are important to TCP, dropping ACK packets will force a TCP connection to resend packets that have arrived already but not ACK. The arguement is that this can degrade your download performance without much of a gain.
I recommend you try it with and without it and see if you notice a difference. Feel free to comment on your results.
- I changed the default class from Low, to Lowest. Again, because a large amount of my traffic is from BitTorrent, I want it be classified as Lowest. You’ll understand when we move on to the other settings.
- I unchecked Prioritize ACK. BitTorrent sends many ACK packets and if you tend to use BitTorrent a lot, the router can get flooded with ACK requests. If you don’t use any type of BitTorrent client, you can leave this checked.NOTE: This is somewhat debatable. Some people argue that ACK packets only take up a small amount of bandwidth, and because they are important to TCP, dropping ACK packets will force a TCP connection to resend packets that have arrived already but not ACK. The arguement is that this can degrade your download performance without much of a gain.
Setting up Outbound Rate /Limit
- Max Bandwidth: Set this to what your max upload speed is provided by your ISP. If you aren’t sure, go to the following sites and get an average. For me, while my ISP advertises 768kbps, on average I got around 400. I’m still playing with that number.
- Next I changed the default settings to reflect something that I feel works better.

- I wanted to be sure that I changed my outbound to give Highest the most bandwidth. By default, it goes 80% to 100%. I wanted to give it a little more so I changed it to 90% to 100%. For most users, your outbound traffic is pretty small. The most common outbound traffic is to resolve host names (DNS). More on that later.
Setting up Inbound Limit
- Max Bandwidth: You’ll end up playing with this number several times before getting it just right. Again, use speedtest sites I cited above to get your average.

- I want Highest to have no bandwidth restrictions so I set this to None (I think that might be default). I will be setting up DNS to use this setting. Also, if you use some sort of VoIP device you’d want it to be set to Highest as well.
- For all the rest of the setting, as you see, I just went down from 98% to 90%. I’ve had good luck with these settings. If you notice some of your lowest priority applications using too much bandwidth while High or Highest applications are running you can adjust it accordingly.
Now that we’ve setup the basic QoS settings, click Save and go to Classification.
Setting up Classification
- This is where you define which protocols get which priority. Depending on what applications you use, or which games you play, your setup might be longer than mine.

- As you can see, I have given DNS the Highest priority. I want names to resolve as quickly as possible.
- Next, I gave some of the common protocols the High priority. Feel free to add any additional ports or protocols. You get the idea.
- I setup IPP2P: BitTorrent to the Lowest priority. For example, I’m downloading something via uTorrent and I decide I want to browse a website. Because the listing of priorities says that port 80 gets the High priority it will “steal” bandwidth from BitTorrent.
I recommend keeping Tomato updated. Usually with every release the author includes updated filters for L7.
- And lastly, I have “Bulk Traffic” set to Lowest.
That is all it takes to setup QoS on Tomato. Remember that this guide is only intended to give you the basic idea. If you go with these setting you should be alright. Tweak the numbers and test to get the best performance from your router and internet connection. It might take a few days or weeks to get it exactly right.
If you have any suggestions or anything that isn’t accurate, please post a comment.





My XBOX 360 is connected to my router. Will this help with latency?
As you see, I setup Xbox Live to have a High priority, to be allowed the most bandwidth use.
The best way to answer your question is to have NOTHING else using your internet connection (stop all web browsing, downloads, etc) and just play on Live. If you still have lag, might be your internet connection.
If you only have lag when people are using the internet, then this will help you for sure.
Thanks for the write up. I will give this a try this evening.
For your max Outbound Rate /Limit, do you just set it to the max? In a few articles/FAQs/forums I’ve read, they suggest setting it 90% of the max. I think the way you have juggled the percentages may have compensated for that.
Have you upgrade 1.10 as yet?
ontguy wrote:
Well, my ISP advertises that I get 768kbps, but when I do random speed tests I get an average around 400 or so.
I wasn’t able to find a definite answer. I’ve read what you’ve read that you take 85% - 90% of your total inbound and outbound, and those are the numbers you enter.
I actually spent a good amount of time testing those numbers out specifically for my ISP (Comcast, sigh). I didn’t want to take 90% of 768, because in every single speed test I did (and I did about 20) I got an average of 400 or so. I thought I’d just use the full 100% of what my average upload (outbound) speed was, since I would sometimes get above 400.
As for my inbound, I get 6mbps, but again I wasn’t getting that on my 20 speed test. I was averaging about 5200-5600, so I took 90% of the 5600.
I played with these numbers for awhile, testing http and ftp speeds with BitTorrent speeds, and after a few changes these numbers gave me the best results.
I have no upgraded to 1.10 yet — it was a small upgrade and what issues it resolved didn’t relate to me. Plus, as easy as it is, I can be lazy.
I meant to add.. the 85% - 90% of your total bandwidth is a good measurement tool, but I wouldn’t simply take what your ISP advertises, do some math and plug those numbers in.
Do what I did.. do 10 speed tests on different servers and take the averages of those. That will give you a really good idea of your general inbound/outbound speeds. Then take 90% of that number.
Too many variables come into play when trying to determine your speed, but as you know, you rarely if ever get all the speed that is advertised.
Let me know how it works out.
I still experimenting with numbers, my ISP is getting the speed of my DSL line tweaked.
I like how responsive the internet is with your setup.
I wanted to get your thoughts on a few things:
- is it a good idea to prioritize ICMP? I don’t couldn’t find a reason to. (http://www.linksysinfo.org/forums/showthread.php?t=52537)
- in that thread it brought up the idea of a “whitelist”, using the “Default Class” as a catch all for the low(est) priority traffic; I might give this a try
- have you found any drawbacks to setting the outbound/inbound limit used by the classification for torrents to a 100%? ideally the bandwidth shuold be utilized 100% of the time; when using the internet is gets the bandwidth it needs, when it’s torrents, etc. they get the bandwidth available
1.11 is out now
I don’t see a need to give ICMP any type of priority. You can, I doubt it would cause any performance issues. ICMP messages are typically generated in response to errors in IP datagrams (as specified in RFC 1122) or for diagnostic or routing purposes.
Yes, if you look at my setup, I did that as well. All traffic that I don’t define will be considered “Lowest” (default Tomato sets this to Low as the default). Though I specifically tell Tomato make torrent traffic the lowest priority as well.
Well, setting your out/in at 100% can cause other things to get throttled. That is why most people recommend the 85%-90% range, to avoid that. But it isn’t almost impossible to get 100% of your advertised bandwidth, too many factors. I just took the average numbers of about 20 different speed tests. This is the most effective way in my opinion to find out your average download and upload speeds.
Thanks for the reply.
I wanted clarify my last question.
the scenario:
- the out/in max bandwidth is set to 85%-90% range
- torrents are put in the lowest priority
- the percentages for the lowest priority is 2% - 70% for in and 95% for out
I take this to mean torrents would never get more than 70% of the out and 95% of the in. Have you experienced performance issues with setting the percentages closer to 100%?
Oh, I see what you’re asking.
To be honest with you, I picked 70% because I thought that was a good enough number to have my torrents use for outbound traffic (how much I’ve upload to other users). I was afraid I’d bottleneck my upload speeds if I picked anything higher. I haven’t tested it too much. Feel free to adjust that number, it will only effect the amount of bandwidth that is used when people are connected to you downloading.
But as you see, I set Lowest at the Inbound level (downloading) to 95%, leaving 5% of my connection open. I felt that 95% of my total bandwidth was enough to not make other services (www, ftp, etc) be slow until the bandwidth shifted towards those higher priority services.
Hi possible to set the QOS/firewall to block completely on p2ptv such as ppstream or sopcast with this tomato firmware ???
Hi
I have to day flashe’d my WBR2-G54 with Tomato 1.1 - marvellous software. Now i can stop my ‘boy’ to sit on the PC all night long. The software has a very good func. - and i am very pleased.
Thanks to the author.
Best regards from Norway
T. Sandberg
Mark, I’m on Comcast as well and am getting really wacky speed test results:
Service Server DownloadUpload
DSLR FtWorth 9061 1131
DSLR Miami 13530 1281
DSLR SanFran 3230 1502
STNET FtWorth 8280 2036
STNET Miami 7345 2029
STNET SanFran 17293 1909
EASY Dallas 10220 2029
EASY Atlanta 13786 2206
EASY SanFran 6225 1936
I’m not sure if this is because if SpeedBoost or what, as well one of the speed test sites gave me an “upload compression detected, your upload speeds may be inaccurate” message. I’m having a really hard time picking what my down/up should be - I don’t want to waste available bandwidth. Any suggestions?
Thanks, Darren
Tomato is really awesome. I’ve tried DD-WRT as well and it’s QoS doesn’t even compare to Tomato’s.
It’s interesting that your ISP advertisers 768 kbps and only gives 400 kbps. I use 90% of advertised speed (which is really the same as actual, woohoo) and it works just fine.
Hi.. I installed the latest tomato firmware and did all the settings above. But when I run my bittorrent on wireless connection for a while my connection suddenly dies and my computer couldn’t find the whr-g54s anymore. I had to restart the router and it still dies on me. Does anyone know why this is happening?
Fantastic article! I’d only learnt about QoS recently, got a Linksys router, installed DD-WRT (which was fun to configure but did nothing for me on the QoS front).
Installed Tomato and was making some progress, but this article has set things up perfectly for me! I’m able to use P2P and run a backup to an online backup service that otherwise hogged my bandwidth.
Fantastic! Thanks! The end of a very long quest to get QoS to work!
I disagree with not prioritizing ACK packets..
Ack packets take up a small amount of bandwith, while at the same time are very important to tcp transfers. Dropping ack’s will force a tcp connection resend packets that have arrived already but not ack’ed, so it will degrade your links performance remarkably, without any significant gain otherwise.
Matthias wrote:
I agree with you if you’re not going to do any torrent downloading. With it enabled (in my case anyway) it would drop connections and severely slow download speeds.
I have a similar problem to Allen. My Linksys WRT54G will lockup usually after a few hours of Bittorrent downloading. I can’t pull up any web pages and internal network traffic dies. I tried changing a most of the QoS settings. QoS definately helps though, after just 10 mins with torrents dling and no QoS I can’t access a web page.
What I would really like to see in QoS/Tomato is some way to constantly monitor in/out bandwidth and make adjustments to the limits. Dream big.
Thanks for this! Tomato is great, but the documentation is… sparse. This was exactly the tutorial I was looking for.
What I’m trying to understand, and can’t find anywhere, is a description of what the Rate/Limit settings do… Limit is the high end and Rate is? How do they work together?
To those who are getting a router lockup with Torrents, make sure you change your Max connections limit to 2048 (found in Tomato’s Advanced settings). You may be maxing your connection limit and this would explain why you can’t get any further connections externally or internally.
You may also want to increase the Max TCP connections in Windows XP (default =10). If you check your Event log and see “EventID 4226: TCP/IP has reached the security limit imposed on the number of concurrent TCP connect attempts” you definitely want to increase this to 50. Here’s a link to a patcher that will do the trick… http://www.lvllord.de/?lang=en&url=tools
Thank you for the posting of Tomato firmware, it sounds like something we should investigate as a good alternative to DD-WRT.
One answer I have been diligently searching for is which firmware actually modifies the packet with the appropriate QoS / Tos bits to priorotize the packets on the network?
Although I understand the priotitization in my local router, I don’t understand how I set / where I set the QoS bits in the packet so the Internet routers can do the same once the packet leave my router.
Can anyone shed some light on this for me. Is it done by this firmware on the outbound side? Is it just not done even though the protocol defines it?
Thank you for your help.
Update:
For those of you who would like the technical details on how the Cisco routers handle this stuff, you can refer to the following link for details on the DiffServ Field.
Notice the last two lines at the bottom where it states that if this field is not set on the way in (into the Internet), then the field will remain 0 (normal treatment in the internet).
… I guess the link would help!
http://www.cisco.com/en/US/tech/tk543/tk757/technologies_tech_note09186a00800949f2.shtml
I used this to set mine up. Now I can play Team Fortress 2 even when everyone else is using Bittorrent, and have a constantly great ping.
Thanks a lot.
Only thing I had to get rid of is the Bulk Traffic thing… isn’t that basically limiting EVERYTHING to lowest? Cause as soon as I removed that, and set the TF2 port to High, everything cleared up.
Or is Bulk Traffic meant to be left at Lowest, and then individual ports set to High override that??
Either way, its working a LOAD better with my current setup than when we used Linksys firmware.
I like to thank Mark for this website and its all about the QoS and Tomato.
I have the WRT54GL for 2 days now and I flash to the new Tomato last night.
I been playing with the numbers and trying to get the best settings.
It end up that I may not use the QoS.
It seem like it is limiting myself to get the most bandwidth.
For example, with my QoS off, I am downloading from my ISP newsgroup at the maximum speed. When I put in the QoS into play, it seems to slow the download down, even if I put it in high priority.
I suggest is if you want to do voice, games, websurfing, just stop your newsgroup and torrent download, then put it back on when you are done with your high priority.
Your thoughts on this?
I don’t think I’d use QoS if I didn’t do many p2p transfers via bit torrent.
In my opinion, most small home networks don’t always need QoS, it all depends on the type of things that are being done. I helped someone setup the WRT54GL router with Tomato, but based on how they used the internet (strictly email, www, and xbox live), I opted to go with no QoS and they haven’t had any complaints regarding speed.
It’s when you have 10 items queued up in your bit torrent client, and your fiancee wants to browse the internet while you’re playing CoD4 on Xbox Live, that is when having QoS setup vs. not having it setup will show.
I found that newsgroup doesnt give out alot of outbound traffic.
The killer is p2p. It generate alot of outbound traffic.
I found that you do not want to put your advertised outbound speed. I get around 290 kbp u/l, so that is the speed I use.
For inbound traffic, why do we need QoS? We cant control this.
While my newsgroup is d/l, I tweak my QoS.
This site below have great info about QoS.
It talk about your QoS upstream if set it too high or too low.
Good stuff:
http://vonage.nmhoy.net/qos.html
great tutorial.
just one minor quibble–ssh is port 22; telnet is port 23.
Thanks for the Article.
here is a screenshot for my qos. maybe can help.
http://frederico-araujo.com/tomato-QOS.png
Hello. I want to setup QoS, but there is one problem. I live in Republic of Georgia. Our ISP is shaping only traffic outside our country, on local internet (Georian) I have symmetrical 10Mbits Upload Download, but outside Georgia 2400kbits Download and 96kbits upload. I have Georgian IP ranges is it possible somehow to make these IP ranges bypass QoS and maximum upload speed?
How about an update for v1.19.1463?
There is a new option to prioritize small packets with these control flags ACK, SYN, FIN and/or RST. Is it worth checking any of these?
thanks for your idea
i don’t know what to do about 1 month that i buy wrt54gl
Maximus wrote:
Trafic shaping takes place on your ISP’s routers. if they are shaping all forms of traffic, there isn’t much you can do…
Do these QoS settings apply for those connected wirelessly? A lot of times my network slows down a lot since there is heavy bittorrent traffic over the wireless, and I was looking for a way to have web=browsing take priority over that.
LordMelkor wrote:
Sure do. The QoS settings apply to all the data wireless or not.
With these QoS settings, web browsing will take priority over anything else.
Ok thanks!
I have a Motorola WR850g, using Vbuzzer for VOIP,
How to set the QoS or Classification high for my VOIP?
Thanks
Paul
Firmware: DD-WRT v24 (05/24/08) std is actually better than Tomato v16 (with the ND), for QoS.
Tomato seems to be working better because it kind of cheats. By default the lowest QoS priority uses 2-95% of the available upload bandwidth. Those of you putting BT rules in will put BT into lowest, which means you will never get the max BW even if it is available and not used. Putting the lowest to 1-100% makes the situation worse.
DD-WRT doesnt artificially limited the total amount (max amount) of BW used. This means the max amount if available to any process, even if it is at the lowest priority (bulk).
You can easily test this by running a BW intensive game and running BT in the background.
With DD-WRT I can BT upload and download much higher than with Tomato while playing SupCom for example. It is a noticable difference.
BTW, if you’re using Tomato, it’s best NOT to create a rule for Bittorrent, and let it default to unclassified / bulk. So make rules for everything except BT and BT will default to whatever is your default speed for an unknown application. This way, you use less cpu cycles on the router.
For DD-WRT, you must make a QoS for http, and for BT you have to make one as well, but create a rule yourself (based on tcp/udp and port(s) used for BT) and dont use the default provided “bittorrent” on list. Because the default provided forces the router to analyze the data packet to determine if it is BT or not so that uses cpu cycles and can be fooled by BT encryption.
Browsing website is as fast as tomato if you create the http and bt QoS rules.
I’m on a network with 8 people. QOS works amazingly well for giving each of us the bandwidth we deserve… nobody can steal all the bandwidth.
I changed the settings a LOT from the suggested ones up top. I got rid of the “bulk traffic” thing. Got rid of Bittorrent prioritizing. Instead, I classified things that needed classifying, and for each user on our network that heavily uses bittorrent, I gave them their own class with their own designated bandwidth. It works great, and other people can be using Bittorrent now while I play games online.
chrisL wrote:
That’s great. Like I said, the guide I provide is just a basic QoS guide. You got to change it for what works for your environment.
I’m due to take another look at my QoS setup to see what I can do to improve it, and maybe post a new guide.
I just found out that TCP Vegas beats using qos for either dd-wrt or for tomato. It completely replaces qos.
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=28816&postdays=0&postorder=asc&start=0
Does tomato have the ability to run vegas as per the link? I no longer have tomato installed.
Also, does tomato have ability to save the above script into the startup of r outer, so that it auto runs upon power up?
Excellent article - I’ve got a WRT54GL, bought because I heard about it’s upgradeablity, but never got around to it. This article has sealed it’s fate - it’s getting Tomato installed on it tomorrow…
Success so far - very impressed. Only snag is that for some reason my wired connection to the router drops out asnd the ip needs releasing/renewing if I play with the router settings too much (not necessarily anything relevant to it’s ip address) - the wireless connections stay up & stable though!
Great article. Thanks.
Question - the latest release of Tomato includes new options for prioritizing small packets (SYN, FIN, RST). Have you played with these and have you seen any advantage to turning them on/off?
Thanks!
just thought i’d report my results with these settings. i haven’t yet found a configuration that concurrently handle bittorrent, web and voip until this article. i run into zero problems so far and couldn’t be happier. thanks again for taking the time. glad to see someone has figured out how to optimize the settings.
Paul T wrote:
Sorry, I failed to update this to say that Tomato has been incredibly stable no matter what I do to it. It seems that I had to do a total reset and configure the basic settttings from scratch and now it’s fine
Thanks for the write up,but can you guys help me with my slingbox?
trying to setup the best upload and download speeds,need some setting you guys are using.
Working out of town all the time so i need max upload speed.
isp download is max at 3000kbs
upload is max at 250 kbs
thank you