Thursday, June 28, 2012

Tomato, the Macintosh, and the Asus RT-N16

If like me you read Jeff's post, bought an Asus RT-N16 intending to run Tomato, realized that the way Jeff upgraded his firmware was by using the Windows-only manufacturer-supplied utility, and you only have a Mac handy—then this post is for you. Below are instructions for upgrading the router's firmware from the terminal, assembled from a few existing articles, and personally validated by me.

Pre-requisites: some comfort at the command line, some familiarity with firmware upgrades.

First of all:

  1. Download the appropriate Tomato USB firmware. You'll need a "Kernel 2.6 for MIPSR2 Routers" version; I used Ext build 54, and I've read that the VPN build works too. Either way you're going to end up with a file like tomato-K26USB-1.28.9054MIPSR2-beta-Ext.trx.
  2. From the menu bar icon, turn off the Wi-Fi on your Mac. We'll not be using that interface.
  3. Connect your Mac via ethernet cable to LAN Port 1 on the router.
  4. Turn the router on.

Now, to perform the upgrade, open Terminal.app or your preferred terminal.

1. Turn off your Mac's ethernet interface:

Isaacs-MacBook-Air:~ isaac$ sudo ipconfig set en0 NONE
Password:
Isaacs-MacBook-Air:~ isaac$

2. Reset the router's NVRAM: hold down the WPS button on the back of the router for 30 seconds. Still holding the button, unplug the router and wait for 30 more seconds. With the button still held down, plug in the router and wait 30 more seconds. Now release the button.

3. Now put the router in recovery mode: unplug it, and then plug back in again while holding the "Recovery" button.

4. Bring your Mac's ethernet interface up with a manually-configured address

Isaacs-MacBook-Air:~ isaac$ sudo ipconfig set en0 MANUAL 192.168.1.2
Isaacs-MacBook-Air:~ isaac$

5. Confirm that you can ping the router at 192.168.1.1:

Isaacs-MacBook-Air:~ isaac$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=0.053 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.217 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.080 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.093 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.053/0.111/0.217/0.063 ms
Isaacs-MacBook-Air:~ isaac$

6. Upload the new firmware using tftp, and wait 90 seconds:

Isaacs-MacBook-Air:~ isaac$ tftp 192.168.1.1
> binary
> put tomato-K26USB-1.28.9054MIPSR2-beta-Ext.trx
6284824 bytes, 2.8 seconds
> q
Isaacs-MacBook-Air:~ isaac$ sleep 90
Isaacs-MacBook-Air:~ isaac$
(update 8/31/2014: some folks have reported their routers to take much longer than 90 seconds to install the newly uploaded firmware. If in doubt, or having problems, you may want to wait up to an hour or two)

7. Unplug the router, and plug it back in again with the WPS button held down. Hold for 30 seconds as the router boots up.

8. Swtich your Mac's ethernet to DHCP:

Isaacs-MacBook-Air:~ isaac$ sudo ipconfig set en0 DHCP
Password:
Isaacs-MacBook-Air:~ isaac$

9. Open the configuration page at http://192.198.1.1/ (username admin, password admin) and change the admin password.

10. Enjoy Tomato!

20 comments:

Unknown said...

Lordy Ise,
You are so frickin' smart, I can't even begin to understand what the hell you are blogging about.

Buckley said...

I just tried doing this on the RT-N66U, and unfortunately its put the router into what I think is recovery mode and I can't get out of it. Any ideas on why this wouldn't have worked or what I can do to get my router functioning again?

Isaac Hepworth said...

If your router's in recovery mode, you should be able to connect to it using tftp. Does that work?

If so, you can just put the original firmware back using tftp. (you can get the firmware at http://support.asus.com/Download.aspx?SLanguage=en&p=11&m=RT-N66U%20(VER.B1)&os=8)

Isaac

Buckley said...

It did not, I'm wondering if I'm messing up steps 2 & 7. On the RT-N66U reseting the NVRAM involves pressing the reset button (and not the wps button). In steps 2 & 7 I'm performing a NVRAM reset and afterwards the router still stays in recovery mode.

Isaac Hepworth said...

Hmm. Can you ping the thing from 192.168.1.2? If you can't do that or tftp to 192.168.1.1 then it's not in recovery mode.

And yes, definitely the N16 treats the reset/wps buttons differently from others.

Buckley said...

I was able to ping the router and tftp to it, its just after I updated the firmware I was always stuck in recovery mode. Thanks for the help, but at this point I think I'm just going to return the router.

Amit Lamba said...

When you say "Recovery" button, do you actually mean "Restore" button?

Unknown said...

7skCan you please make a new blog entry? Every time I look at this one I see "Anus". You're a father, have dignity.

thumbwarz said...

Hi, I'm hoping you can help me. I had, I believe, a bad flash attempt before following your steps. After following your steps, the router seems to have recovered (the power button doesn't blink. WAN light is on. LAN-1 light is on) and my Mac is able to acquire an IP address via DHCP. But I can't access 192.168.1.1 (or anything else, while connected via ethernet) in my browser.

Any ideas?

Thanks

thumbwarz said...

I'm using Mountain Lion, btw, and I wonder if that has to do with it.

Daniel Epstein said...

Thanks for the post. Quick question.

After I ping 192.681.1.1

I change directory to the folder containing the trx file

I then
tftp 192.681.1.1
binary
put filename.trx

But the transfer times out after about 5-10 seconds. Any suggestions?



R Jones said...

Your last step should point the user to http://192.168.1.1 (there's a typo in current version of page).

Eva Cyrus said...

I believe, a bad flash attempt before following your steps. After following your steps, the router seems to have recovered (the power button doesn't blink. WAN light is on. LAN-1 light is on) and my Mac is able to acquire an IP address via DHCP.http://www.theremoval.com/directory/removals-companies-town.php?id=1110&name=Greenwich

Robert said...

worked great for me! thanks a lot!

Vinbax said...

These instructions are great. Thanks!

I installed Shibby's TomatoUSB on my RT-N66U (hw rev B1). I found I had to physically unplug & replug my Ethernet cable after step 9 to re-establish a connection to the router, but otherwise these instructions worked flawlessly.

Brett said...

Thanks for the help! Worked great, except I had to do
# sudo ifconfig en0 down
# sudo ifconfig en0 up

before I could ping the router.

Also, you have a tiny typo in step 6, "tftp 192.681.1.1" should be 168, I believe.

Thanks!
Brett

Isaac Hepworth said...

Thanks Brett—I corrected the typo. Glad it worked for you.

Son of Krypton said...

Hi Isaac- for someone who's been using Macs for a while but never had touched the Terminal app, your instructions were enough to walk me through a successful install of the same Tomato build that you suggested.

THANK YOU!

I chose to buy the Asus RT-N16 because a couple of IT gurus at work said it's a beast- not sure what they meant, but as a non-IT guy that sounded like something I'd do well with.

My WIFI download speeds are around 16-18 mpbs, but on LAN I get about 80 mbps. I suspect that the WPA2 setting doesn’t help :-/

Anyway, thank you for taking the time to blog these excellent instructions!

s
11.4.13

Son of Krypton said...
This comment has been removed by the author.
Lacy Brown said...

Your Tech Support rating is ridiculous. You need call ASUS about hardware issues. Not just how to’s. There hardware support is horrible.
Asus Technical Support