Lucky for you lifehacker have an article on how to do exactly this.
Open the Tomato Admin Scripts interface You'll need to login with the user name and password you set in your instructions for installing Tomato. Once you're logged in, make sure to click on the WAN Up tab.
Copy the ad-block script to Tomato. I'd recommend going directly to the source, since the author of the script updates it regularly.
You should paste the script into the blank text area in the WAN Up tab
3 . Save the script by clicking the Save button.
4.Reboot your router to enable the script. That's all there is to it. Next time you visit a web site, you should notice a conspicuous lack of ads. The same should be true from any computer, as long as it's connected to your Tomato router. There are some unfortunate bits and pieces about this method versus the Adblock extension that you might want to take into consideration before setting it up on your router. First, if you want to whitelist a site, you have to manually edit the script by changing the following section:
## remove/whitelist websites ## removes 3 websites (aa.com, bb.com, cc.com) ## remove the # and edit the website urls. sed -i -e '/aa.com/d' $GENFILE
...replacing aa.com with the site you wanted to whitelist. Keep in mind that whitelisting does not work for whitelisting all ads on a specific site—instead, if you're having trouble opening a site you want to look at because it's on a blacklist, whitelisting that site will let you access that one specific site.
Unfortunately the script doesn't allow you to whitelist all ads on specific sites.