Upgrade the router using Tomato firmware

Monitor bandwidth and quality of service (QoS) on the router line using Tomato firmware, combined with two tools, Mark Vejvoda's IPTables Bandwidth Monitor and Script 's Robert Generator' Mytkowski.

Monitor bandwidth and quality of service (QoS) on the router line using Tomato firmware, combined with two tools, Mark Vejvoda's IPTables Bandwidth Monitor and Script Generator by Robert "Robson" Mytkowski.

Upgrade the router using Tomato firmware Picture 1Upgrade the router using Tomato firmware Picture 1

Unless you buy an expensive router that costs about ten million, otherwise, with several million routers running Linux it is hard to expect bandwidth management features to be available. However, you can do that with customized Linux versions.

In this article, the user of Linksys WRT54GL version 1.1 is priced at VND 1.2 million. To buy the right device running Tomato (Linux kernel), you should know about the types of routers using Broadcom chipset that have enough flash memory (usually from 4MB or more) and RAM (from 16MB or more). You can find Tomato-compatible routers mentioned on Tomato's website (http://www.polarcloud.com/tomato).

About Tomato

Upgrade the router using Tomato firmware Picture 2Upgrade the router using Tomato firmware Picture 2 This is a compact and simple firmware version with an easy-to-use web interface - an advantage of Tomato because when it comes to Linux-based routers, many people are afraid of the complexity of using the command line to configure. Of course, for those who already know OpenWRT with the included X-WRT version or with DD-WRT , the web interface is not new. But Tomato has a more user-friendly interface because it uses AJAX and describes bandwidth with graphics features. Tomato does not require you to restart the router each time you change the configuration.

You can refer to the video clip at: http://www.polarcloud.com/v/scbwm.htm. Tomato has many other features. Useful or not . depends on your needs. If you want a list of Tomato features, see: http://en.wikipedia.org/wiki/Tomato_(firmware)#Features

Installing Tomato is not difficult. The Tomato website has a fairly complete tutorial or in the readme.htm file that comes with the firmware you downloaded. However, Tomato will reuse the router's available configuration, so the installation will be like an upgrade, only then will you have a new interface with more features.

Upgrade the router using Tomato firmware Picture 3Upgrade the router using Tomato firmware Picture 3 Tomato's interface has Bandwidth section for bandwidth monitoring, QoS for service quality management, Access Restriction allows creating rules to manage access . according to each TCP / UDP port and P2P download restrictions (peer to peer) or hourly usage. The Administration section of Tomato has a number of options different from the available firmware of common routers like Debugging (quite familiar to you who have worked with Cisco IOS). Or the CIFS Client and JFFS2 section to access shared folders on the local network or use flash memory as a file folder. In addition, Scripts and Scheduler section is the place for you to add features that Tomato does not have, if you know how to exploit. As for monitoring normal bandwidth, Tomato is available in real time or every day, every week, every month. But if you want to monitor bandwidth by IP address or limit / customize the download of users, you will have to combine 2 scripts and scheduler with 2 tools that will be introduced later.

Track bandwidth by IP address

Why do you need to monitor bandwidth usage by IP address?

To use Mark Vejvoda 's IPTables Bandwidth Monitor with Tomato, you must use Static Lease of the DHCP service to fix the user's IP address. This makes it very easy for Tomato, just go to the Device List section , select each user's IP address and click the [ static ] text directly below, the interface of Static DHCP will appear, you can type the username or name the computer in the Hostname field , click Add and that's it for a user. Just repeat this until the list of your users is gone.


Upgrade the router using Tomato firmware Picture 4Upgrade the router using Tomato firmware Picture 4 You need to set up a shared folder to store the log and the necessary files for the IPTables Bandwidth Monitor package. You can use flash memory, but for simplicity, you can start with CIFS Client first. You create a shared folder on a computer in the local network, granting write access to a username on the computer. Then use the username and password to declare in the CIFS Client section . The UNC path should use the hostname according to the IP address, in the form: xxx.xxx.xxx.xxxsharedfolder . If you do it right, after clicking Save and waiting for Tomato to restart the necessary services, Total / Free Size will show the maximum and available space of the above shared folder.

Next, download the IPTables Bandwidth Monitor package from here and extract the ipt-parse.7z file to get the folder called tomato_files . Copy the contents of this folder into the above shared folder.

On Mark Vejvoda's wiki page, there are two ways to guide: using logfile or using SQLITE database . This article only mentions the second way. Go to Scripts under the Administration section, select the Firewall tab and type the following command into the empty box: / cifs1 / ipt-parse 6 .

Click Save and let Tomato restart the necessary service. Then go to Scheduler , select Custom 1 , click Enable. Choose Time as ' Every 15 minutes ' and make sure you choose Everyday in the Days section. In the Command box, type the following command lines:

cd / cifs1
./ipt-parse 2 BANDWIDTH "iptables -L traffic_all -vnx" "iptables -Z traffic_all"
./ipt-parse 4 today today BANDWIDTH flags = morehostinfo> dailybandwidthlive.html
./ipt-parse 4 today-7 today BANDWIDTH flags = morehostinfo> weeklybandwidthlive.html

(You can go to Mark Vejvoda's wiki page to copy and paste the command line)

Click Save and wait for Tomato to restart the service. If you get it right, and the username to access in CIFS Client is sufficient, after 15 minutes in the shared folder, there will be 2 files with the .html extension with information on the bandwidth usage of each IP address. You have declared in Static Lease of DHCP.

If successful and still want to explore more, the wiki has instructions on how to put the above 2 report pages on the router. At that time, you will access those two pages according to the address of the router as follows: http://xxx.xxx.xxx.xxx/ext/dailybandwidthlive.asp with the letter x is the IP address of the router. Or you can directly insert the contents of the tomato_files folder into flash memory, no need to use shared folders.

QoS

Upgrade the router using Tomato firmware Picture 5Upgrade the router using Tomato firmware Picture 5 Tomato provides the following interfaces for you to manage the translation quality of bandwidth traffic on the network. As mentioned above, View Details section is very useful for you to know who-what-is-doing on your network. From there you can adjust, or even restrict, rules in the Access Restriction section.

However, Robson 's Script Generator gives you more power than Tomato's available features. (See picture)

You can specify to each IP address, or range of IP addresses, or ports, or even a range of ports with own bandwidth, how many connections . Even prioritize a certain type of traffic.

Script Generator simply writes the Linux command on your behalf, after you've set up rules that serve your needs, follow its instructions. It will then export to the command line. You just copy and paste them into Scripts section, in the Firewall tab. Save and if possible, restart the router.

4.8 ★ | 5 Vote