Using dd-wrt on the Cisco Linksys e4200 v1 router


Over the years, in our home lab, I’ve tested numerous wireless routers from a number of manufactures. Most have been returned because they simply can’t support the needs of our environment. We first evaluated the Linksys e4200 v1 when our treasured D-Link b/g router failed after years of reliable service.

At the time, the Cisco Linksys e4200 v1 had just been replaced by a newer model, the v2, that used a different chipset that claimed improved wireless-N support on both 2.5 & 5 GHz. Specials were offered by Cisco on the v1 router. After reading the specs and reviews, it appeared the v1 was worth serious consideration.

Our infrastructure is used 24 x 7 x 365 for demanding Internet, multi-stream video, file transfers and VoIP service. We track network & service outages using pingdom.com. Any failure of the e4200 router causes services to not be available and recorded.

The e4200 wireless b/g/n 2.5 & 5 GHz router has been a stable work horse for almost five years. It’s able to handle a large number of concurrent connections while under heavy load from both wired and wireless traffic. All this without failing or requiring resets.

Given our highly regarded e4200 is now approaching five years of age, I’ve started the search for a replacement router to support our ever increasing network demands. With the introduction of new AC wireless routers such as the Linksys EA8500 with impressive specs and claims of much greater bandwidth and higher performance, our interest is peaked. So far, nothing has handled our requirements for performance and stability. Nothing has increased wireless distance in 2.5 or 5 GHz.

I’ve been asked “What firmware do we use in our Cisco Linksys e4200 v1?”

At this time, we use the latest stock firmware available from Cisco. It provides the most stable routing for our demanding environment.

I attempt to keep current with developments in a number of router firmware projects such as OpenWRT, Tomato and dd-wrt. Each offers a richer, more flexible feature set, compared to stock firmware. I’ve evaluated new releases for the e4200 and other routers we have owned.

I’ve become a big fan of dd-wrt. While we have not yet located a stable dd-wrt release for our Linksys e4200 router, our older Linksys WRT610N router has been given a new purpose in life thanks to features in dd-wrt. The firmware has the ability to turn a router into a wireless bridge. This wireless bridge supports our network traffic to a color laser printer, color scanner, ps3, xbox xbmc, WeMo devices and HDTV.

One of the keys to a stable network is finding a router with a stable firmware level available. Either stock firmware from the manufacture or firmware available from one of the router firmware projects.

During our search for improved firmware for the e4200, I came across the following material written by Steve Jenkins at http://stevejenkins.com

Steve’s site was down but has returned to life. Perhaps, he was offline testing a new dd-wrt level 🙂 I’ve included material from his blog on the latest dd-wrt firmware available for the Linksys e4200. I look forward to trying this firmware level on our backup “e4200” router.

This post is a reference post for those looking to squeeze maximum speed out of their Cisco Linksys E4200 v1 wireless router runningDD-WRT. The DD-WRT build I currently recommend for this router is 27490(by BrainSlayer).

Optimizing DD-WRT on the Linksys E4200 v1

The Linksys E4200 router is an excellent choice for power-users looking to squeeze the most out of their network. It uses simultaneous dual-band 2.5 and 5 GHz antennas, which allows wireless clients to connect at speeds up to 300 and 450 Mbps on each antenna, respectively. For physical connections, it boasts four Gigabit Ethernet ports for high-speed wired LAN connections and a USB 2.0 port for attaching devices such an external hard drive or printer, which makes the device accessible on the network.

The first version of the E4200 (commonly referred to as the v1) is powered by a Broadcom BCM4718 chipset running at 480MHz with 64MB of total RAM and 16MB available flash. That’s good news for router hackers, because the Broadcom chipset means it will support third-party open source firmware (such as Tomato or DD-WRT), while the 16MB of available flash means the fully-loaded “big” and “mega” versions of those firmwares (which boast all the cool features) will comfortably fit on-board with space to spare.

Unfortunately, the newer E4200 v2, which was released after the original, is powered by a Marvell CPU and chipset, which is unsupported by third party firmware, meaning the E4200 v1 is the last — and widely recognized as the best — wireless router that Linksys has produced with third-party firmware support. As of this post, they’re still available in the Linksys Home Store as refurbished units for $79.99. Hint: If you call them @ 877-959-7467 instead of ordering it online, tell them you read my blog and ask for the extra 15% discount!

If you simply unbox your E4200 and run it with the stock firmware, it’s a great router. It’s fast, easy to set up, fast, feature-rich, fast, reliable, and fast. But, it’s possible to make it even faster, more reliable, and more feature-rich by installing a current build of DD-WRT firmware.

DISCLAIMER: Following are the steps I used to get my router how I like it. You might want things another way, and that’s totally fine. If you have a router other than the E4200, v1 don’t follow these instructions. They will not work with the E4200 v2. Keep in mind that it’s possible to render your router inoperable if you install firmware that’s not specifically designed for your router or skip any steps when installing. Proceed with caution and at your own risk. It’s strongly advised that any firmware updates be made with a computer that’s connected to the router via a physical Ethernet cable. Once the firmware is loaded, I also like to mess with configuration settings via a physically connected computer, just in case I hose something in the wireless settings and can’t reconnect.

Ready? Let’s go!

1. After verifying that I had the original “v1″ version of the E4200 (it just says “E4200″ on the bottom, and not “E4200 v2″), I read the entire DD-WRT Wiki entry for the E4200. It’s very important that you follow those instructions when upgrading your router, especially when it comes to doing a proper 30/30/30 hard reset when required.

2. The first time you flash this router, you must use a build of the firmware that’s made specifically for the E4200, or you’ll ruin it. A DD-WRT build that’s router-specific is called a “trailed” build. Trailed builds contain model-specific headers that allow flashing from the router’s stock firmware, and will always have the model number of the router in the filename. The DD-WRT E4200 Wiki entry recommends using an older mini build for your first E4200 v1 flash, but you can use any “trailed” build that says “e4200″ in the filename and you’ll be fine.

My trailed build recommendation for your initial flash of a E4200 is dd-wrt.v24-27490_NEWD-2_K2.6_mini-e4200.bin (yes, I know that’s different than what the DD-WRT wiki says, but it’s the only place where the wiki and I don’t agree). Again, don’t try to use anybuild other than a “trailed” build on your first flash of an E4200, or you could brick your router (meaning make it as useful “as a brick”).

I found a decent YouTube video where a guy named Dan Carter walks through the DD-WRT firmware upgrade process on a stock E4200. He goes through pretty slowly, but if this is your first DD-WRT install, it’s not a bad idea to watch. Keep in mind the versions he installs are older than the ones I reference in this post, so use my newer filenames while you follow along with his process, and you’ll be fine.

3. As stated in the DD-WRT.com wiki entry: “WARNING AFTER installing DD_WRT, ONLY flash -nv60k builds, Flashing anything else to the router will brick it as noted above.” This means that after you’ve flashed the trailed build above, any and all subsequent flashes must be with DD-WRT firmware files containing -nv60k in the filename. The ONLY exception to this rule is that it’s alsoalways safe to flash a trailed build for your router at any time (even on top of a previously flashed trailed build).

4. Once you’ve completed your initial flash with the “mini” build listed above, you’re ready to flash the “mega” build I recommend for the E4200 router, which is currently BrainSlayer’s dd-wrt.v24-27490_NEWD-2_K2.6_mega-nv60k.bin build. The “mega” build in this step provides all available DD-WRT functions (as opposed to the smaller “standard” and “mini” builds), including the popular OpenVPN, and as a result is much larger than the mini build in size. But since the E4200 has plenty of RAM available to run this build, it’s the one I run on my E4200 router. This build will probably meet or exceed your needs, too, and so for the vast majority of users (including power-users), that’s what I recommend. Remember: flash a trailed mini build (liked the one in step #2) first, directly from your stock Cisco/Linksys firmware. Then, once you have any version of DD-WRT running on your router, you can upgrade to a more recent and/or bigger trailed build or -nv60k build (like the one in this step). Remember, though not required, it’s always safest to do another 30/30/30 reset before attempting to install a different DD-WRT build.

5. Because a large number of wireless devices in my house are Apple consumer products (iPods, iPads, iPhones, etc.), I wanted to optimize my speeds for Wireless-N devices like these. Following are the non-default settings I currently have configured on each tab and sub-tab in my router’s DD-WRT admin interface. If a setting isn’t mentioned, it’s because I’ve left it at the default. Again, your perfect settings may be different than these. I’ve arrived at these after reading through tons of discussions in the DD-WRT Forums combined with a lot of personal experimentation and testing. I also recommend reading through some of the DD-WRT Wiki Tutorialsthat might address some of your particular needs.

Be sure to press the “Save Settings” button at the bottom of a tab’s page before clicking to a new tab. Otherwise, you’ll lose your changes. This saves your new values, but doesn’t apply them. You’ll need to press “Apply Settings” after you’ve saved all your desired settings, after which you’ll likely need to reconnect your wireless devices.

Setup : Basic Setup

  • Router Name: Use any name you like, like “Home Gateway Router”
  • Host Name: Anything will work here, but I always use “gateway”
  • Local IP Address: 192.168.1.1
  • Subnet Mask: 255.255.255.0
  • Gateway: 0.0.0.0
  • Local DNS: 0.0.0.0
  • DHCP Server: Enable, and leave all the defaults. Also, I recommend putting in 8.8.8.8 and 8.8.4.4 (Google’s DNS servers) for Static DNS 1 &2 for fast DNS lookups.
  • NTP Client: Enable
  • Time Zone: Pick the appropriate one based on where you are (I picked US/Pacific)
  • Server IP/Name: pool.ntp.org

Wireless : Basic Settings

Because the E4200 has simultaneous antennas, the first wireless interface (wl0) runs on the 2.4 GHz band and the second (wl1) runs on the 5GHz band. I use mostly default values here for both antennas. The Wireless Network Mode you choose will depend on whether or not you have older B devices on your network. If you do, you’ll need to used “Mixed.” In most cases, however, you can set it like I do: “NG-Mixed” on wl0 and “N-Only (5GHz)” on wl1. This allows the faster N devices to access the 5GHz antenna without competition from G devices, which can drop the speed. However, some N devices only run on 2.4 GHz channels, so that’s why I configure the 2.4 antenna to support both N and G.

Note that I use the same SSID for both antennas, so devices can “hop” between them smoothly.

Depending on how many other WiFi networks exist in your area, it may be useful to tinker with manually setting channels and channel widths. If you live in a more “congested” area with lots of WiFi signals, you may want to experiment and find the channels that give you the least interference. The lower the interference, the higher your speeds. I recommend installing the free utility inSSIDer to scan for WiFi signals and help determine the best channel(s) for your area.

In my neighborhood, there’s not a lot of interference, so I’ve found I get great results using “Auto” for the Channel and Channel Width settings for the 2.5GHz (wl0) antenna. However, according to DD-WRT contributor Fractal, with the 5GHz (wl1) channel you “have to make sure that you change the channel from auto to something like 165, as auto selects a DFS channel like 36 or so, and a large portion of WiFi cards dont operate that low in the 5Ghz band.”

So my manual settings for the wl1 (bottom) section of this tab are:

  • Wireless Channel: 149 (but you can choose any channel above 100)
  • Channel Width: 40Mhz
  • Extension Channel: lower (but upper is fine too, just choose an appropriate Wireless Channel)

If any of the options revert to “Auto” when you press Save, just change one of the other options (like Channel Width or Extension Channel) and try again. Some manual options won’t become available until you hit Save after changing another one.

I also set the Sensitivity Range (ACK Timing) to 0 on both antennas to turn it off. I’ve found I don’t need it, and I get more speed by doing so.

Wireless : Wireless Security

Here’s where a lot of people make the wrong choice and cost themselves speed. Set Security Mode to “WPA2 Personal” and WPA Algorithms to “AES.” Using any other settings will cost you serious speed. Choose a decent password for your WPA Shared Key.

Wireless : WL0-Advanced & WL1-Advanced

These are the advanced settings tab for both your antennas. I make the following changes to the defaults on both.

  • CTS Protection Mode: Disable (only if you have no Wireless B clients on your network)
  • Frame Burst: Enable
  • Preamble: Short
  • TX Power: (see below)
  • Afterburner: Off

Don’t be tempted to disable the WMM Support in an attempt to get more speed by disabling something. This is actually part of the Wireless-N spec, and is required for max speed.

I’ve left a discussion of TX (transmit) power for last because there’s no consensus on exactly what these should be. That’s because everyone’s “perfect” setting will be different, based on your environment. In general, you want to run at the lowest possible setting that allows the fastest connection. If your antenna’s TX power is set too low, the signal won’t be strong enough for your clients to find throughout your home or office. But if it’s too high, the signal actually overpowers and “blows out” your connection, resulting in lower speeds. The stock firmware sets both antennae at 100mW for both antennas. This seems to work fine for the 2.4GHz antenna in my setup, but I’ve noticed faster throughput on the 5GHz channel by reducing the TX power to 51mW. Some experimentation and wireless speed testing is strongly suggested to find the perfect settings for you. Start at the defaults, run a speed test, and then tinker away. Wherever you end up, I wouldn’t take the 5GHz antenna (wl1) over 71 under any circumstances (I’ve seen no improvements above that level), and I wouldn’t take the 2.4GHz antenna (wl0) over 128 (you risk damage to the device by overheating).

Services : Services

  • SSHd: Enable
  • SSH TCP Forwarding: Disable
  • Password Login: Enable
  • Telnet: Disable
  • ttraff Daemon: Disable. If you leave this enabled, you can store traffic logs, but they fill up eventually (it takes years) and might cause some wonkyness when your router runs out of flash RAM. Most people leave this Enabled, but I really don’t need it, so I shut it off.

NAT/QoS : Port Forwarding

I set up whatever port forwards I need for my network. Yours will obviously be customized for your needs.

NAT/QoS : UPnP

  • UPnP Service: Enable
  • Clear port forwards at startup: Enable

NAT/QoS : QoS

A full discussion of QoS is best left to a separate blog post. For max speed in an ideal environment, QoS should be disabled. But if you have a lot of network clients competing for your bandwidth, you’ll get the highest “effective” speeds by enabling and configuring it properly. I normally have it turned off at my house, but will enable it if we have lots of people visiting with smart phones.

Administration : Management

Not much in here will affect your speeds, with the possible exception of IP Filter Settings, so just configure options to your liking. IP Filter Settings and TCP Congestion Control discussions are like holy wars in some forums. However, after reading a DD-WRT forum post in which Fractal (who is one of the lead developers working on DD-WRT) shared his experiences and preference for Westwood TCP Congestion Control, I now run Westwood on this tab.

Administration : Commands

I have some custom firewall script commands in this tab, but I discuss those in depth in a separate post.

For speed optimization, I include some commands in my router’s start-up script (which is stored in its RAM as rc_startup). I store my most current version of this startup script as a GIST, and you can always find the latest version here.

I’ve broken my optimizations into three sections: LAN adapter tweaks, wireless adapter tweaks, and tweaks to the TCP settings. I’ve added comments to my startup script (they’re fine to paste into the DD-WRT interface) to help you understand what they’re doing.

In the LAN adapter tweaks section, the ifconfig eth0 txqueuelen option is an attempt to lower what’s called buffer bloat (feel free to look up more on that yourself). The default is 1000, and some people set it as low as 1 or 2. I’ve found 5 works well on my network, but it’s something I tinker with from time to time. Play with it to see what works best on your network (but never set it to 0).

In the wireless adapter tweaks section of my script, I enable automatic wireless interference mitigation mode and noise reduction (interference mitigation mode 3) for both antennas’ networks. For many owners of this router, this can provide a dramatic improvement in wireless speeds.

In the TCP tweaks section, I propose increased values for some buffers and other TCP settings on the router, which have been shown in some cases to help users with really fast connections (100+ mbits/second) achieve max speeds. These TCP tweaks may do nothing to increase speeds on your network, but they won’t hurt anything and might help.

view rawe4200-startup.sh hosted with ❤ by GitHub

Press the “Save Startup” button to save the commands to your router’s rc_startup, which will run every time the router boots.

Note a couple of things. First, the “sleep 10″ lines (which tell your router to wait for 10 seconds before running the next line of the script) before the interference mitigation commands are required. I’m not exactly sure why, but my testing verifies that it won’t properly set these modes without them. Second, I’ve found that on routers like the E4200 that have dual radios (2.Ghz and 5Ghz), you can’t set the interference mitigation mode for the 2.4 Ghz antenna (eth1) via the startup script or DD-WRT’s GUI interface at all. I believe this is a bug, and I’ve reported it here. Until this bug is fixed, line 18 of the script won’t have any effect on your router. If you’re using this script on a Broadcom-based router that only has a 2.4Ghz antenna, the script will work fine. Although I’d suggest commenting out lines 22 and 23 since your router doesn’t have an eth2.

Finally, keep in mind that if you make any changes to the wireless settings (channel, channel width, etc.) after your router boots, you’ll need to manually run the wireless interference mitigation commands again to re-enable it. The easiest way to do that is to reboot your router after you’ve tweaked your wireless settings to your liking (and saved them).

That’s pretty much it! Those are the configuration changes I make from the DD-WRT defaults to achieve max speed. For most users, stop here and enjoy your fast router.

For the hardcore, or for those feeling brave, you may want to consider experimenting with overclocking your E4200.

Speed Tests

To give you an idea of the type of speeds I’m getting with my routers, I tested on three separate networks that run the Linksys E4200 using DD-WRT with above configuration tweaks. They are:

  • Our primary residence network near Seattle, WA connected via Comcast Xfinity Cable Internet with SpeedBoost (theoretical max should be 40 Mbits)
  • Our part-time residence in Provo, Utah, connected via Veracity Networks on the city’s 12Mbit fiber backbone (theoretical max should be 12 Mbits)
  • Our cabin in East Wenatchee, WA, connected via LocalTel on the Douglas County P.U.D. fiber backbone (theoretical max = ????)

Below are some speed test results from those networks:

Wenatchee, WA – Ethernet on PC

Wenatchee, WA – WiFi on Laptop

Seattle, WA – Ethernet on PC

WiFi connection on iPhone 4

Provo, UT – Ethernet on PC

Provo, UT – WiFi on Laptop

I welcome your feedback, including suggestions for improvement or alternate settings that work for you, in the comments below. Happy optimizing!

Other Available E4200 v1 Builds & K2.6 vs. K3.x

Currently, the only DD-WRT builds I recommend for the E4200 v1 are the “trailed” mini and K2.6 mega builds referenced above. But I often receive questions as to whether the Linux 3.x kernel builds run better on the E4200. My experience is that they do not — and in fact, DD-WRT developer Kong has confirmed to me that because the 3.x kernel requires more space than the 2.6 kernel, some of the features in the K2.6 versions were removed from the K3.x ones.

I tested it myself, and there is zero noticeable performance improvement when running the K3.x builds on the E4200. There might be on other routers (such as the Netgear R7000… which I’m currently testing). But for now, for the Linksys E-Series routers, my recommendation mirrors Kong’s: stick with K2.6 kernel.

Of course, this is open source software, so you’re free to experience and test out any builds you like… but you’re always on your own. Beta builds of DD-WRT are located at ftp://ftp.dd-wrt.com/betas/. But unless you know how to recover a bricked router, I recommend that you do not experiment with these builds until you have confirmed their stability via the DD-WRT forums, or this blog post (which I do keep updated). Builds that appear on that Beta FTP server are not tested prior to release (that’s why they’re called beta builds). I don’t provide support for DD-WRT, so if you brick or otherwise hose your router, you are on your own… and I recommend visiting the DD-WRT forums for help.

In other words, if you ignore my advice and post in the comments below that you flashed some other build (including a K3.x build) and it didn’t work, I’ll reply and refer you to this paragraph in the friendliest way possible, and wish you luck. :)

Outdated Builds I No Longer Recommend:

Following are builds I’ve tested and found to be stable with the E4200 v1, but no longer recommend them only because I’ve tested a newer build enough to consider it stable on the E4200:

  • kingkong-nv60k-broadcom.bin – This is Kong’s extremely well tested and rock-solid version of build 22000, with the Heartbleed bug patched. I ran (and recommended) this build for a long time with much success. It’s still awesome.

List of E4200 Router Wireless Radio Capabilities

For those who are interested, if you want to show the wireless radio capabilities of your E4200 v1 router, you can issue the “wl cap” in the Administration:Commands tab or on the command line in a telnet/ssh session. Here’s a key of the wireless capabilities reported:

  • ap: supports Access Point mode (can act as an access point)
  • sta: supports Station Mode (can act as a client to an access point)
  • wet: supports Bridged Client Mode (Wireless Ethernet Transceiver Mode)
  • led: (still researching — possibly supports flashing LED on activity)
  • wme: supports Wireless Multimedia Extensions (also known as WMM)
  • pio: supports Programmed Input/Output for data transfers
  • 802.11d: supports the IEEE 802.11d standard
  • 802.11h: supports the IEEE 802.11h standard
  • rm: (still researching)
  • cqa: (still researching)
  • mbss16: (still researching, although possibly size of Flash ROM)
  • afterburner: supports 125 High Speed/Afterburner/SpeedBooster mode
  • ampdu: supports Aggregation of MAC Protocol Data Units
  • amsdurx: supports reception (RX) of Aggregated MAC Service Data Units
  • amsdutx: supports transmission (TX) of Aggregated MAC Service Data Units
  • acktiming: adjustable Sensitivity Range/Acknowledgement Timing
  • rxchain_pwrsave: (still researching)
  • radio_pwrsave: (still researching)
  • bcm_dcs: (still researching)

Leave a comment