Summary

Tomato is an aftermarket firmware project for the following routers:

The firmware is developed by the same author who wrote HyperWRT Tofu. This firmware is not a HyperWRT derivative.

The project page may be found at http://www.polarcloud.com/tomato

The major emphasis of Tomato is on speed and efficiency.

Installing

Before the Upgrade

Installing on a Linksys WRT54G, WRT54GL or WRT54GS

Installing on a Buffalo WHR-G54S/WHR-HP-G54S

Warning: Be aware that Buffalo only has encrypted firmwares on their web site. You will not be able to revert back to Buffalo's firmware without an unecrypted version of their firmware.

The following is for an initial install on a Buffalo router. If you're already using a third-party firmware or just upgrading a Tomato firmware, try uploading any of the .bin files from the GUI.

The default router address is 192.168.1.1. The CFE and future TFTP upgrades will also default to this address and will following the settings entered in the GUI.

Upgrading The Firmware

Menus in Tomato

Status

Provides information on the current condition of the router.

Overview

The Overview screen shows information on the current state of the router. It is organized into four sections:

Device List

Provides a list of the current devices that have been assigned an IP address by the DHCP server. Devices are listed by Interface, which indicates where on the router they are connected:

Logs

Allows you to view the Internal system logs (assuming Internal Logging is enabled - see "Logging" under "Administration").

Bandwidth

Real-Time

Displays a chart, updated every second or so, of the last 10 minutes of bandwidth used. Tabs at the top allow you to select the various interfaces for detail on the bandwidth for that interface.

Last 5 Hours

Daily

Monthly

Tools

Ping

Allows you to ping computers on the Internet to verify connectivity.

Trace

Wireless Survey

WOL

Basic

Network

Identification

Time

DDNS

Static DHCP

Wireless Filter

Advanced

Conntrack / Netfilter

Adjustments for the number of connections and persistence for each connection in the Network Address Translation (NAT) table.

This is mostly relevant for people who use P2P or other connection-intensive applications on their Internet connections. The connection table has a finite number of entries, and if the entries are all used up, the router cannot make new connections. The only way to free up an entry is to gracefully terminate a connection (normal), or to have one time out. Since P2P applications rarely drop connections gracefully, they need to depend on the router to time out their connections for them.

The most important settings are:

Most of the remaining settings would generally be used pretty rarely, and are probably present for adjustment by advanced users who might need to tweak their network settings.

Many sites recommend adjusting these values using a script such as this one:

echo 4096 > /proc/sys/net/ipv4/ip_conntrack_max
echo 2048 > /proc/sys/net/ipv4/neigh/default/gc_thresh2
echo 4096 > /proc/sys/net/ipv4/neigh/default/gc_thresh3
echo "600 1800 120 60 120 120 10 60 30 120" > /proc/sys/net/ipv4/ip_conntrack_tcp_timeouts

However, the two settings in the GUI listed above will accomplish everything the oft-published scripst claim to do, with less effort. Specifically, the Established TCP Timeout setting replaces the "1800" in the last line of the script, and the ip_conntrack_max number is controlled by the Maximum Connections setting. The gc_thresh settings are not really useful, it's better to let Tomato use its defaults for thresholds.

DHCP / DNS

Firewall

MAC Address

Miscellaneous

Routing

Wireless

Port Forwarding

Port Forwarding allows you to tell the router what to do with unsolicited data coming from the Internet. Usually, packets coming in from the Internet will be in response to some request that one of your computers has made. In these cases, the router keeps track of who made the request, and forwards the response to that computer.

However, in the case of "Server" applications, that receive random connections from the Internet, you need to tell the router which computer is running the server. This is generally done by telling the router that any "unsolicited packets" (packets that are not a response to a request from a local computer) on a specific port or list of ports should be forwarded to a specific computer on the network.

There are a few ways to set this up.

Basic

Allows you to specify simple port forwards (all packets received on the specified External Ports will be routed to the specified Internal Address.

Optionally, you can change the local port by specifying Int Port. This is also known as Port Redirection. This technique is handy, for example, if you have two web servers. Both could be listening on the default port (80), but the router could be set to forward received packets on Internet Port 80 to Port 80 on the first web server, and packets on Internet Port 81 to Port 80 on the second web server.

DMZ

DMZ, or Demilitarized Zone, allows you to specify one device on your network that will receive all unsolicited packets from the Internet. This can be handy for devices that need largely unrestricted access to the Internet, or for a Web/email server. However, this bypasses all firewall functions of the router for this device, so be sure the device is very well secured.

Triggered

Port Triggering is an on-demand port forward. The router will look for an outbound connection on a specified port, and will forward all of the requested ports to whatever computer initiated the outbound connection.

Under the Trigger Ports, you would enter a list of the ports that your computer will use to initiate the forwarding. Then you specify the ports you want to forward to that computer under Forwarded Ports. Any computer that sends outbound packets on any of the ports listed in Trigger Ports will then have all unsolicited packets received from the Internet on the Forwarded Ports sent to it.

UPnP

Universal Plug and Play (UPnP) allows devices on your network to set their own port forwards. A computer running a web server, for example, can tell the router to forward all communications on port 80 and/or 443 to it. This allows your local devices to add, delete, and update port forwards at will.

There are some security disadvantages to UPnP, such as a trojan horse or other "bad" software package being able to forward ports to a given machine so the malware can use your computer as an Internet server. However, there are also security ADVANTAGES to UPnP, since any well-behaved UPnP application will request cancellation of its forwarded ports when it shuts down or no longer needs them. This reduces the number of unneeded forwarded ports.

QoS

QoS, or Quality of Service, allows you to prioritize data, slowing down less important data to allow more important data to get through first.

This is primarily useful for outbound data (data going from your computers to the Internet). Inbound data cannot be prioritized effectively because it has already passed through the bottleneck (your Internet connection) by the time the router has a chance to evaluate it.

Basic Settings

Max Bandwidth: One of the major limitations of QoS in most Linksys routers is their inability to determine the upstream speed of the Internet connection. This is true of many router models. The most effective way to tune QoS is to do an Internet speed test with QoS turned off. Then enter about 90% of the tested upstream (upload) bandwidth into the Max Bandwidth field. This will allow the router to properly determine how much bandwidth is available and prioritize packets accordingly. A more detailed explanation of this may be found at http://vonage.nmhoy.net/qos.html

Classification

Allows you to specify which connections will get what levels of priority. This will override the default priority set in the Basic Settings page. Classification may be done by MAC address, TCP/IP port, or using more advanced filters like IPP2P or Layer 7 (L7) filtering.

View Graphs

One of the most powerful features of Tomato, this allows you to view (in near-real-time) the current outbound connections and how the QoS engine is classifying them. This allows you to view how effective your QoS settings are, and whether they are capturing the connections you want them to. Simply click on any of the classes to view the list of specific connections for that class.

View Details

Lists each connection that has recently been made through the router, and what QoS class was assigned to that connection. Clicking any entry will attempt to do a reverse lookup on the destination TCP/IP address, or you can click on the "automatically resolve addresses" checkbox at the bottom of the list to resolve all addresses in the list (this can take a while).

Access Restriction

Administration

Admin Access

Bandwidth Monitoring

Buttons / LED

CIFS Client

Configuration

Allows you to save your current configuration to a file, restore a previously-saved configuration, or restore the router to factory defaults.

When changing from one firmware to another, it is important to do a complete factory reset on your router. In Tomato, you go to this screen, select Erase all data in NVRAM (thorough), and click OK. When the router reboots, you will need to rekey all of your configuration settings manually.

JFFS2

Logging

Logging may be done internally or externally. Internal logs save information to the router's local memory. External logs send the log information to a computer running software like WallWatcher, where the logs can be captured and analyzed without taking up memory on the router.

Log Internally saves the connection logs to the internal memory of the router, where they may be extracted or viewed directly on the "Logs" page under "Status". These logs will consume router memory, but may be viewed directly on the router itself.

Log Externally sends the logs to a computer on your LAN. That computer must be running a log capture program, like WallWatcher. The computer can then show you the connection logs and analyze the data.

The remainder of the settings allow you to specify what types of connections you want logged, and to place a limit on the number of log entries per minute to send.

Miscellaneous

Scripts

Upgrade

Allows you to load a new firmware to the router (either a newer version of Tomato or an entirely different firmware).

Note: When changing from any firmware to any other firmware (stock Linksys -> Tomato, for example), it is important to clear the NVRAM and restore the factory default settings. Instructions on doing that will vary from firmware to firmware, but there is generally a factory reset option (in Tomato, this is located under Administration/Configuration/Restore Default Configuration

About

Reboot...

Restarts the router (without erasing any settings).

Shutdown...

Logout

Logs you out of the firmware (clears your user session). This will dump you back to the initial login, where you are asked to present your credentials again (which causes occasional confusion, with people reporting that they "need to log in in order to log out"). Once you see the password prompt, you are logged out. Just hit cancel and you will end up at the "Unauthorized" page.



Additional Notes

Known Problems

QOS / Access Restrictions Notes

Miscellaneous Notes

Tools

Support