WiFi connection on iPhone 4

My Cisco Linksys E4200 DD-WRT Settings for Max Speed 680


Maximizing WiFi Speed

UPDATED Dec 21, 2016. This post is a reference post for those looking to squeeze maximum speed out of their Cisco Linksys E4200 v1 wireless router running DD-WRT. The DD-WRT build I currently recommend for this router is K2.6 30880 (by BrainSlayer).

IMPORTANT: My testing shows that DD-WRT K2.6 builds are much faster on the E4200 vs. DD-WRT K3.x builds. But if you’re still convinced you want to run a K3.x build, read this article before migrating.

Also, you can always access my partial mirror containing recommended E4200 builds at http://ddwrt.stevejenkins.com/.

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.

With older builds, it used to be advisable to first flash a trailed “mini” build, then go to a more full-featured build. This is no longer necessary. With the newer DD-WRT builds, you can now flash directly to a trailed build of any size supported by your router (depending on how much RAM it has), including the “mega” build on the E4200.

DD-WRT K2.6 vs. K3.x Builds on the Linksys E4200

The decision as to whether to run a K2.6 build or a K3.x build on your router is up to you. DD-WRT K3.x builds are stable enough to run, but they yield much slower WiFi and wired network speeds on the E4200, so I still recommend you run the K2.6 builds (see my head-to-head testing on the E4200).

If you’re running a K2.6 DD-WRT build on your router and want to upgrade to K3.x (even though it’s slower), it is extremely important that you first do a 30-30-30 reset when upgrading from K2.6 to K3.x. Yes, you will lose all your settings and will have to manually reconfigure everything. No, you can’t save a backup file and restore it to the newer build. Read my article about why the 30-30-30 reset is required. If you ignore it, you’ll regret it!

My current trailed build recommendation for the E4200 is the K2.6 30880 “mega” build. Yes, 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, never try to use any build 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”).

The “mega” build of DD-WRT 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.

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. This is a bit misleading, because it’s only true for the K2.6 builds. For the K3.X builds, you can flash any newer NEWD-2_K3x_mega.bin build once you have any other K3.x build on your E4200. And in every case, it’s always safe to flash a trailed build for your router at any time (even on top of a previously flashed trailed build). So, to be safe, I always flash a trailed build on my E4200.

4. Once you’ve completed your initial flash and have DD-WRT running on your router, you can always move to a different build later. Remember, for K2.6 builds, the E4200 always needs either a trailed build or a -nv60k build. If you already have a K3.x build on your E4200, you can upgrade to a trailed K3.x build or the main NEWD-2_K3.x_mega.bin build.

Also remember that it’s always safest to do another 30/30/30 reset before attempting to install a different DD-WRT build, but that it’s absolutely required when migrating from K2.6 to K3.x builds.

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 Tutorials that 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 America/Los_Angeles)
  • Server IP/Name: pool.ntp.org

Wireless : Basic Settings

I leave the Regulatory Domain stuff alone. It defaults to Regulatory Mode Off, which is how I leave it.

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 don’t 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. You may have to also Apply Settings if it continues to be stubborn.

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.

To create your speed-optimization startup script, copy and paste the following lines into the Command Shell text area:

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” line (which tells your router to wait for 10 seconds before running the next line of the script) at the top of the script is required. I’m not exactly sure why, but my testing verifies that the first line of the script is often ignored, so I included this “throw-away” command to make the script work.

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, the eth1 interference line of the script won’t have any effect on your router. Update: it appears that as of 27805, the eth1 interference mitigation mode issue has been fixed.

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 the eth2 line 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 1 Gigabit Google Fiber. Router is used only as an access point.
  • 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

Seattle, WA – WiFi on iPhone 4

Access Point only mode in Provo, UT

Access Point only mode in Provo, UT

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 found there is a major performance drop in both wired and wireless network speeds when running the K3.x builds on the E4200. The K3.x builds might not be so bad on newer routers with faster processors and more RAM, but for now, on the Linksys E-Series routers, my recommendation mirrors Kong’s: stick with K2.6 kernel.

If you decide to try out the K3.x builds anyway (it’s easy to safely switch back with a K2.6 trailed build after a 30-30-30-reset), please read this article to understand why you must do a 30-30-30 reset before migrating.

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 and it didn’t work, I’ll reply and refer you to this paragraph in the friendliest way possible, and wish you luck. 🙂

Partial DD-WRT Mirror of Recommended Builds

Because the DD-WRT beta FTP site can sometimes be flaky, I’ve started hosting a partial mirror of the builds I recommend at http://ddwrt.stevejenkins.com/. It will always host the following files for the recommended build:

  • RECOMMENDED #1: dd-wrt.v24-XXXXX_NEWD-2_K2.6_mini-e4200.bin – the K2.6 trailed “mini” build. Perfect for a first-time flash from stock if you want to use the K2.6 kernel.
  • RECOMMENDED #2: dd-wrt.v24-XXXXX_NEWD-2_K2.6_mega-nv60k.bin – the K2.6 non-trailed “mega” build, which you should flash following the trailed mini build. Only use this if you’re already running another K2.6 DD-WRT build.
  • dd-wrt.v24-XXXXX_NEWD-2_K3.x_mega-e4200.bin – the K3.x trailed build for the E4200. Perfect for a first-time flash from stock if you want to use the K3.x kernel, but be warned that you’ll get much lower network speeds (both wired and WiFi) with a K3.x build.
  • dd-wrt.v24-XXXXX_NEWD-2_K3.x_mega.bin – the K3.x non-trailed build for the E4200, and other routers that will support it. Use only if you’re already running another K3.x DD-WRT build. Note that you’ll get much lower network speeds (both wired and WiFi) with a K3.x build.

Outdated DD-WRT Builds I Still Recommend

The only outdated DD-WRT build that I still recommend for the E4200 is Kong’s 22000++ build. It might not have all the latest features, but This it’s extremely well tested and a 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, so I also host it on my partial mirror.

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)