Disable Asus RT-N66U error redirect

I bought an ASUS RT-N66U “Black Knight” a few months back to improve wifi coverage in our new apartment (big rooms, thick walls, lots of interference from neighboring wifi networks), and I have been quite happy with its performance so far. There is just one thing that drove me up the walls: When the WAN link would go down for whatever reason, the RT-N66U detects this and then redirects all requests to itself to show an error page (http://router-ip/error_page.htm?flag=X) instead. This feature can not be disabled using the user interface, and it is severely annoying. You lose the original URL, any POSTDATA, … it sucks. There is a workaround where you manually set the DNS server, but that, too, is very annoying if you use many different networks.

Fed up, I finally took to the source code, which ASUS make available thanks to the GPL. And I finally found the culprit: ASUS have a program called wanduck, which handles all sorts of WAN-related things, including the redirect (wanduck.c:366-410). Most interesting is line 399, which checks for a nvram flag, and then pretends the connection is always up. Not the most elegant solution, but it works. Here’s how you set it up:

First, log in to your RT-N66U’s web interface. Then go to the Administration menu and open the System tab. Enable the telnet server by setting “Enable Telnet” to “Yes”. Click Apply, wait for the changes to complete, then telnet to your router’s IP address and log in with the same username and password you use for the web interface. Once you’re at the command prompt (which should look like admin@RT-N66U:/tmp/home/root#), simply run: nvram set web_redirect=0. You’re done! The change should take hold immediately.

Notes: I am linking to the source code of a modified version of the ASUS firmware, but the code exists in the stock source, too, it simply isn’t on Github. I recommend you disable the telnet interface again if you don’t need it, because your password and all data is sent in the clear. I also recommend you look at the asuswrt-merlin firmware I linked to, which fixes some bugs and (re-)enables some features ASUS disabled in the stock firmware.

3 Replies to “Disable Asus RT-N66U error redirect”

Comments are closed.