Ok, this is the easy one. Once you have your router loaded with alternative OS (like OpenWRT or Routerbot OS which is also based on OpenWRT) issue the following command:
dmesg | grep CPU
This command will show you the current CPU frequency. Good chance the current frequency is 200MHz. Now please stop and think if you really need to overclock your router. It is not supposed to be a number cruncher or something with ultra high performance. I overclocked mine just for hacking sake so I can say this hack is implemented, but why would you do that? For the same reason? Ok then. Type in the following commands:
nvram set clkfreq=<freq>
The frequency <freq> is not just any frequency, but one of the available ones. This article on openwrt website lists possible frequencies for different models and explains how they are working in detail: http://wiki.openwrt.org/oldwiki/openwrtdocs/hardware/linksys/wrt54g. I used 225MHz for my WRT54G-TM and do not plan to go higher for awhile.
WARNING Before you overclock the CPU by some large percentile please make sure you provide good cooling system for the CPU. Copper radiator (I used aluminium) and fan are highly recommended. Also there is a good chance you will brick your router at frequencies 250 and over, so make sure you have serial interface for the router (so you can restore the default frequency from CFE) and, better, JTAG. Also make sure you have JTAG programmer and know how to use it.
Want to go extreme? Read this post: http://www.bitsum.com/openwiking/owbase/ow.asp?WRT54G. It describes how to go over the allowed frequencies by using alternative CFE. Good luck with that! I’ll do the same later.